This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
:disabled="v.disabled || false"
|
||||
>
|
||||
</el-option>
|
||||
<el-option v-if="options.length === 0" label="无数据" value="__NO_DATA__" disabled />
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
@@ -39,7 +40,7 @@
|
||||
|
||||
// 合并默认配置和自定义配置
|
||||
const config = reactive({
|
||||
placeholder: `${t('table.searchBar.searchSelectPlaceholder')}${prop.item.label}`, // 修改默认placeholder文案
|
||||
placeholder: `${t('table.searchBar.searchSelectPlaceholder')}${prop.item.label}`,
|
||||
...(prop.item.config || {})
|
||||
})
|
||||
|
||||
@@ -56,14 +57,12 @@
|
||||
// 计算属性:处理选项数据
|
||||
const options = computed(() => {
|
||||
if (prop.item.options) {
|
||||
// 判断options是数组还是函数
|
||||
if (Array.isArray(prop.item.options)) {
|
||||
return prop.item.options
|
||||
} else {
|
||||
return prop.item.options()
|
||||
}
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
return []
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user