Skip to content

Commit eb7b731

Browse files
committed
feat(demo): add height option
1 parent 7ab9744 commit eb7b731

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

demo/App.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const formState = reactive({
2020
newFilename: 'newPackage.json',
2121
hideHeader: false,
2222
hideStat: false,
23+
maxHeight: '',
2324
})
2425
2526
const oldString = ref(oldShortText.value)
@@ -185,6 +186,12 @@ function toggleLang() {
185186
<a-switch v-model:checked="formState.forceInlineComparison" />
186187
</a-form-item>
187188
</a-col>
189+
<a-col :md="8" :sm="24">
190+
<a-form-item>
191+
<slot><span class="form-item-label">{{ t('options.maxHeight') }}</span> </slot>
192+
<a-input v-model:value="formState.maxHeight" placeholder="500px" style="width: 12vw;" />
193+
</a-form-item>
194+
</a-col>
188195
</a-row>
189196
</a-form>
190197
</a-card>
@@ -194,7 +201,7 @@ function toggleLang() {
194201
:diff-style="formState.diffStyle" :force-inline-comparison="formState.forceInlineComparison" :output-format="formState.outputFormat" :context="formState.context"
195202
:trim="formState.trim" :no-diff-line-feed="formState.noDiffLineFeed" :filename="formState.filename"
196203
:new-filename="formState.newFilename" :hide-header="formState.hideHeader" :hide-stat="formState.hideStat"
197-
@diff="printEvent"
204+
:max-height="formState.maxHeight" @diff="printEvent"
198205
/>
199206
</div>
200207
</div>

demo/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const i18n = createI18n({
4747
hideHeader: '隐藏首部',
4848
hideStatistics: '隐藏统计信息',
4949
forceInlineComparison: '强制行内对比',
50+
maxHeight: '固定高度(带上单位)',
5051
},
5152
},
5253
en: {
@@ -74,6 +75,7 @@ const i18n = createI18n({
7475
hideHeader: 'Hide Header',
7576
hideStatistics: 'Hide Statistics',
7677
forceInlineComparison: 'Force Inline Comparison',
78+
maxHeight: 'Height(with unit)',
7779
},
7880
},
7981
},

0 commit comments

Comments
 (0)