1
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user