Commit 4b3d2d21 by aonoa Committed by GitHub

fix: Clear the input box when closing the search (#4467)

Signed-off-by: aonoa <1991849113@qq.com>
1 parent 31f6cc64
...@@ -30,16 +30,21 @@ const props = withDefaults( ...@@ -30,16 +30,21 @@ const props = withDefaults(
}, },
); );
const keyword = ref('');
const searchInputRef = ref<HTMLInputElement>();
const [Modal, modalApi] = useVbenModal({ const [Modal, modalApi] = useVbenModal({
onCancel() { onCancel() {
modalApi.close(); modalApi.close();
}, },
onOpenChange(isOpen: boolean) {
if (!isOpen) {
keyword.value = '';
}
},
}); });
const open = modalApi.useStore((state) => state.isOpen); const open = modalApi.useStore((state) => state.isOpen);
const keyword = ref('');
const searchInputRef = ref<HTMLInputElement>();
function handleClose() { function handleClose() {
modalApi.close(); modalApi.close();
keyword.value = ''; keyword.value = '';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!