diff --git a/apps/web-antd/src/views/system/dict/data/tag-style-picker.vue b/apps/web-antd/src/views/system/dict/data/tag-style-picker.vue index b118b9f0..754b52f7 100644 --- a/apps/web-antd/src/views/system/dict/data/tag-style-picker.vue +++ b/apps/web-antd/src/views/system/dict/data/tag-style-picker.vue @@ -10,6 +10,13 @@ import { import { tagSelectOptions } from '#/components/dict'; +/** + * 需要禁止透传 + * 不禁止会有奇怪的bug 会绑定到selectType上 + * TODO: 未知原因 有待研究 + */ +defineOptions({ inheritAttrs: false }); + defineEmits<{ deselect: [] }>(); const options = [ @@ -31,21 +38,22 @@ const selectType = defineModel('selectType', { type: String as PropType, }); +/** + * color必须为hex颜色或者undefined + */ const color = defineModel('value', { - default: '', - type: String, + default: undefined, + type: String as PropType, }); function handleSelectTypeChange(e: RadioChangeEvent) { - // 必须给默认hex颜色 不能为空字符串 - if (e.target.value === 'custom') { - color.value = '#FFFFFF'; - } + // 必须给默认hex颜色 不能为空字符串 + color.value = e.target.value === 'custom' ? '#000000' : undefined; }