Skip to content

Commit

Permalink
Merge pull request #19 from xiaoluoboding/fix/search
Browse files Browse the repository at this point in the history
fix: fixed the debounce search bug #18
  • Loading branch information
xiaoluoboding authored Sep 20, 2023
2 parents 9eb25fc + 5d72166 commit b0cf37c
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

1 comment on commit b0cf37c

@vercel
Copy link

@vercel vercel bot commented on b0cf37c Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vue-command-palette – ./

vue-command-palette-xlbd.vercel.app
vue-command-palette-git-main-xlbd.vercel.app
vue-command-palette.vercel.app

Please sign in to comment.