Skip to content

Commit

Permalink
fix: Clear the input box when closing the search (#4467)
Browse files Browse the repository at this point in the history
Signed-off-by: aonoa <1991849113@qq.com>
  • Loading branch information
aonoa authored Sep 22, 2024
1 parent 31f6cc6 commit 4b3d2d2
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down

0 comments on commit 4b3d2d2

Please sign in to comment.