xiaoluoboding / vue-command-palette

⌨️ A fast, composable, unstyled command palette interface for Vue.
https://vue-command-palette.vercel.app
MIT License
530 stars 26 forks source link

Support for configurable fuse search #8

Closed tomieric closed 1 year ago

tomieric commented 1 year ago

We need to customize some content, not just the label, but others, such as content, description fields

const fuseOptions = {
  threshold: 0.2,
  keys: ['label', 'content', 'description']
}

Therefore it is necessary to provide a configurable parameter that will reconfigure the value of fuseOptions

const props = defineProps({
  theme: {
    type: String,
    default: 'default'
  },
  fuseOptions: {
     type: Object,
     default: () => ({
       threshold: 0.2,
       keys: ['label']
    })
  }
})
KeJunMao commented 1 year ago

hi, Command.Dialog can't set fuseOptions, Is there any good way?

hackoder commented 10 months ago

@tomieric I'm curious how you are using other keys, like content and description in your example. From what I can tell, the only way to pass a value is using data-value on Command.Item, which will convert the object to a string.