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(
},
);
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 = '';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!