Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for configurable fuse search #8

Closed
tomieric opened this issue Dec 14, 2022 · 2 comments · Fixed by #9
Closed

Support for configurable fuse search #8

tomieric opened this issue Dec 14, 2022 · 2 comments · Fixed by #9

Comments

@tomieric
Copy link
Contributor

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']
    })
  }
})
tomieric added a commit to tomieric/vue-command-palette that referenced this issue Dec 14, 2022
xiaoluoboding added a commit that referenced this issue Dec 14, 2022
@KeJunMao
Copy link

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

@hackoder
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants