Skip to content

Commit

Permalink
chore(interactive): fix clear event does not take effect (#1997)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hongbusi committed Dec 14, 2022
1 parent 9575433 commit 92d2470
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions interactive/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ import { onBeforeRouteUpdate } from 'vue-router'
import type { ResultItem } from '~/types'
import { input, isSearching, searchResult, selectIndex, userConfigLoading } from '~/composables/state'
const route = useRoute()
const router = useRouter()
const inputEl = $ref<HTMLInputElement>()
const vFocus = {
mounted: (el: HTMLElement) => el.focus(),
}
watch(
() => route.query.s,
async (val) => {
input.value = String(val || '')
},
)
async function executeSearch() {
if (input.value)
isSearching.value = true
Expand Down

0 comments on commit 92d2470

Please sign in to comment.