fix(table-search-fields): 修复搜索框的组件无法使用的问题。
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user