Skip to content

Commit

Permalink
feat(demo): add height option
Browse files Browse the repository at this point in the history
  • Loading branch information
09473ZH committed May 9, 2024
1 parent 7ab9744 commit eb7b731
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion demo/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const formState = reactive({
newFilename: 'newPackage.json',
hideHeader: false,
hideStat: false,
maxHeight: '',
})
const oldString = ref(oldShortText.value)
Expand Down Expand Up @@ -185,6 +186,12 @@ function toggleLang() {
<a-switch v-model:checked="formState.forceInlineComparison" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item>
<slot><span class="form-item-label">{{ t('options.maxHeight') }}</span> </slot>
<a-input v-model:value="formState.maxHeight" placeholder="500px" style="width: 12vw;" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-card>
Expand All @@ -194,7 +201,7 @@ function toggleLang() {
:diff-style="formState.diffStyle" :force-inline-comparison="formState.forceInlineComparison" :output-format="formState.outputFormat" :context="formState.context"
:trim="formState.trim" :no-diff-line-feed="formState.noDiffLineFeed" :filename="formState.filename"
:new-filename="formState.newFilename" :hide-header="formState.hideHeader" :hide-stat="formState.hideStat"
@diff="printEvent"
:max-height="formState.maxHeight" @diff="printEvent"
/>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions demo/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const i18n = createI18n({
hideHeader: '隐藏首部',
hideStatistics: '隐藏统计信息',
forceInlineComparison: '强制行内对比',
maxHeight: '固定高度(带上单位)',
},
},
en: {
Expand Down Expand Up @@ -74,6 +75,7 @@ const i18n = createI18n({
hideHeader: 'Hide Header',
hideStatistics: 'Hide Statistics',
forceInlineComparison: 'Force Inline Comparison',
maxHeight: 'Height(with unit)',
},
},
},
Expand Down

0 comments on commit eb7b731

Please sign in to comment.