Skip to content

Commit f989ab9

Browse files
committed
refactor(ma-dict-select): 重构字典选择器插槽逻辑并更新依赖版本
1 parent 776620b commit f989ab9

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

web/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"@imengyu/vue3-context-menu": "^1.4.4",
2222
"@mineadmin/echarts": "^1.0.5",
2323
"@mineadmin/form": "^1.0.33",
24-
"@mineadmin/pro-table": "^1.0.63",
25-
"@mineadmin/search": "^1.0.31",
24+
"@mineadmin/pro-table": "^1.0.67",
25+
"@mineadmin/search": "^1.0.33",
2626
"@mineadmin/table": "^1.0.33",
2727
"@vueuse/core": "^12.7.0",
2828
"@vueuse/integrations": "^12.7.0",

web/src/components/ma-dict-picker/ma-dict-select.vue

+9-10
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,16 @@ const model = defineModel<any>()
4040

4141
<template>
4242
<el-select v-model="model" v-bind="$attrs">
43-
<slot name="default">
44-
<template v-if="dictionaryData">
45-
<template v-for="item in dictionaryData as Dictionary[]" :key="item">
46-
<el-option :value="item.value" :label="item?.i18n ? t(item.i18n) : item.label">
47-
<slot v-if="$slots.optionDefault" name="optionDefault" />
48-
</el-option>
49-
</template>
50-
</template>
51-
</slot>
5243
<template v-for="slot in Object.keys($slots)" #[slot]>
53-
<slot v-if="slot !== 'default'" :name="slot" />
44+
<slot :name="slot">
45+
<template v-if="dictionaryData && slot === 'default'">
46+
<template v-for="item in dictionaryData as Dictionary[]" :key="item">
47+
<el-option :value="item.value" :label="item?.i18n ? t(item.i18n) : item.label">
48+
<slot v-if="$slots.optionDefault" name="optionDefault" />
49+
</el-option>
50+
</template>
51+
</template>
52+
</slot>
5453
</template>
5554
</el-select>
5655
</template>

0 commit comments

Comments
 (0)