Browse Source
fix: Clear the input box when closing the search (#4467)
Signed-off-by: aonoa <1991849113@qq.com>
pull/4472/head
aonoa
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
8 additions and
3 deletions
-
packages/effects/layouts/src/widgets/global-search/global-search.vue
|
|
|
@ -30,16 +30,21 @@ const props = withDefaults( |
|
|
|
}, |
|
|
|
); |
|
|
|
|
|
|
|
const keyword = ref(''); |
|
|
|
const searchInputRef = ref<HTMLInputElement>(); |
|
|
|
|
|
|
|
const [Modal, modalApi] = useVbenModal({ |
|
|
|
onCancel() { |
|
|
|
modalApi.close(); |
|
|
|
}, |
|
|
|
onOpenChange(isOpen: boolean) { |
|
|
|
if (!isOpen) { |
|
|
|
keyword.value = ''; |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
const open = modalApi.useStore((state) => state.isOpen); |
|
|
|
|
|
|
|
const keyword = ref(''); |
|
|
|
const searchInputRef = ref<HTMLInputElement>(); |
|
|
|
|
|
|
|
function handleClose() { |
|
|
|
modalApi.close(); |
|
|
|
keyword.value = ''; |
|
|
|
|