refactor: reset on leave
This commit is contained in:
parent
4f9ca4bd17
commit
458c1663bf
2 changed files with 7 additions and 1 deletions
|
|
@ -38,6 +38,10 @@ const emit = defineEmits([
|
|||
'submit',
|
||||
])
|
||||
|
||||
defineExpose({
|
||||
reset,
|
||||
})
|
||||
|
||||
function keydown(e: KeyboardEvent) {
|
||||
if (e.key === 'Escape' && props.open === true) {
|
||||
emit('update:open', false)
|
||||
|
|
@ -63,7 +67,6 @@ function submit() {
|
|||
keyword: props.keyword,
|
||||
category: props.category,
|
||||
})
|
||||
emit('update:open', !open), reset()
|
||||
}
|
||||
|
||||
const createKeyword = ((val, done) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue