修改DictSelect组件onChange事件

This commit is contained in:
zhoumingfa 2025-02-23 23:20:49 +08:00
parent 3ac76495ae
commit 66147e47da

View File

@ -97,17 +97,7 @@
const emit = defineEmits(['update:value', 'change']); const emit = defineEmits(['update:value', 'change']);
function onChange(value) { function onChange(value) {
if (!value) {
emit('update:value', []);
emit('change', []);
return;
}
if (Array.isArray(value)) {
emit('update:value', value); emit('update:value', value);
emit('change', value); emit('change', value);
} else {
emit('update:value', [value]);
emit('change', [value]);
}
} }
</script> </script>