fix(table-search-fields): 修复搜索框的组件无法使用的问题。

This commit is contained in:
dk
2026-06-23 10:04:39 +08:00
parent 632c123112
commit 10418fea0a

View File

@@ -68,7 +68,6 @@ const props = withDefaults(defineProps<Props>(), {
}); });
interface Emits { interface Emits {
(e: 'update:modelValue', value: Record<string, any>): void;
(e: 'search'): void; (e: 'search'): void;
(e: 'reset'): void; (e: 'reset'): void;
} }
@@ -133,11 +132,8 @@ function handleSearch() {
} }
function updateFieldValue(field: SearchField, value: any) { function updateFieldValue(field: SearchField, value: any) {
const nextValue = field.transformValue ? field.transformValue(value) : value; // eslint-disable-next-line vue/no-mutating-props
emit('update:modelValue', { props.modelValue[field.key] = field.transformValue ? field.transformValue(value) : value;
...props.modelValue,
[field.key]: nextValue
});
} }
function getFieldValue(field: SearchField) { function getFieldValue(field: SearchField) {