Skip to content

Commit

Permalink
fix: fixed the debounce search bug #18
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoluoboding committed Sep 20, 2023
1 parent 9eb25fc commit 5d72166
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/CommandRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineComponent({

<script lang="ts" setup>
import { provide, ref, onMounted, watch, nextTick, computed } from 'vue'
import { refDebounced, useDebounceFn } from '@vueuse/core'
import { refDebounced } from '@vueuse/core'
import Fuse from 'fuse.js'
import { useCommandState } from './useCommandState'
Expand Down Expand Up @@ -365,7 +365,7 @@ emitter.on('selectItem', (item) => {
emit('select-item', item)
})
const debouncedEmit = useDebounceFn((isRerender: boolean) => {
const rerenderMenuList = (isRerender: boolean) => {
if (isRerender) {
shouldRerender.value = isRerender
initStore()
Expand All @@ -375,9 +375,9 @@ const debouncedEmit = useDebounceFn((isRerender: boolean) => {
shouldRerender.value = false
})
}
}, 100)
}
emitter.on('rerenderList', debouncedEmit)
emitter.on('rerenderList', rerenderMenuList)
onMounted(() => {
initStore()
Expand Down

0 comments on commit 5d72166

Please sign in to comment.