This commit is contained in:
wujinliang
2026-08-25 12:51:32 +08:00
parent bff9ccbfb6
commit 8b3aae399a
2 changed files with 7 additions and 8 deletions
+5 -6
View File
@@ -118,7 +118,7 @@ function resetPreference() {
}
function updateField(key: string, value: QueryValue) {
model.value = { ...model.value, [key]: value }
model.value[key] = value
}
function defaultPlaceholder(field: QueryField) {
@@ -148,11 +148,9 @@ function search() {
function reset() {
if (props.loading) return
const next = { ...model.value }
for (const field of props.fields) next[field.key] = resetValue(field)
model.value = next
emit('reset', next)
if (props.searchOnReset) emit('search', next)
for (const field of props.fields) model.value[field.key] = resetValue(field)
emit('reset', model.value)
if (props.searchOnReset) emit('search', model.value)
}
function searchFromTextInput(event: KeyboardEvent) {
@@ -184,6 +182,7 @@ defineExpose({ search, reset })
clearable
v-bind="field.props"
@update:model-value="updateField(field.key, $event)"
@clear="search"
@keyup.enter.exact="searchFromTextInput"
>
<template #prefix><Search :size="16" /></template>