fix(table-search-fields): 修复搜索框的组件无法使用的问题。
This commit is contained in:
@@ -68,7 +68,6 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
});
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: Record<string, any>): void;
|
||||
(e: 'search'): void;
|
||||
(e: 'reset'): void;
|
||||
}
|
||||
@@ -133,11 +132,8 @@ function handleSearch() {
|
||||
}
|
||||
|
||||
function updateFieldValue(field: SearchField, value: any) {
|
||||
const nextValue = field.transformValue ? field.transformValue(value) : value;
|
||||
emit('update:modelValue', {
|
||||
...props.modelValue,
|
||||
[field.key]: nextValue
|
||||
});
|
||||
// eslint-disable-next-line vue/no-mutating-props
|
||||
props.modelValue[field.key] = field.transformValue ? field.transformValue(value) : value;
|
||||
}
|
||||
|
||||
function getFieldValue(field: SearchField) {
|
||||
|
||||
Reference in New Issue
Block a user