perf: 下拉菜单显示优化

This commit is contained in:
zxc
2026-05-17 13:27:40 +08:00
parent 46c2ffcbbc
commit 30a1d88a18
3 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -4569,7 +4569,7 @@
},
"node_modules/pptxtojson": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/pptxtojson/-/pptxtojson-2.0.3.tgz",
"resolved": "https://registry.npmjs.org/pptxtojson/-/pptxtojson-2.0.3.tgz",
"integrity": "sha512-uUUT2qYvxaSXunqAIgSCHOHPbpinmsMgKQeOoJU4j03l9sTM3TvKeeZsJ7IKIMgxCqhq2g7dbY2eusGJZ4UZkw==",
"license": "MIT",
"dependencies": {
@@ -9174,7 +9174,7 @@
},
"pptxtojson": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/pptxtojson/-/pptxtojson-2.0.3.tgz",
"resolved": "https://registry.npmjs.org/pptxtojson/-/pptxtojson-2.0.3.tgz",
"integrity": "sha512-uUUT2qYvxaSXunqAIgSCHOHPbpinmsMgKQeOoJU4j03l9sTM3TvKeeZsJ7IKIMgxCqhq2g7dbY2eusGJZ4UZkw==",
"requires": {
"jszip": "^3.10.1",
+3 -1
View File
@@ -65,11 +65,13 @@ const props = withDefaults(defineProps<{
options: SelectOption[]
disabled?: boolean
autofocus?: boolean
defaultLabel?: string
search?: boolean
searchLabel?: string
}>(), {
disabled: false,
autofocus: false,
defaultLabel: '',
search: false,
searchLabel: '搜索',
})
@@ -86,7 +88,7 @@ const optionsRef = useTemplateRef<HTMLElement>('optionsRef')
const searchInputRef = useTemplateRef<InstanceType<typeof Input>>('searchInputRef')
const showLabel = computed(() => {
return props.options.find(item => item.value === props.value)?.label || props.value
return props.options.find(item => item.value === props.value)?.label || props.defaultLabel || props.value
})
const showOptions = computed(() => {
@@ -101,6 +101,7 @@
<div class="row">
<Select
style="width: 100%;"
defaultLabel="自定义"
:value="viewportRatio"
@update:value="value => updateViewportRatio(value as number)"
:options="[