-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CommandPalette): handle
filter
attribute in groups (#871)
- Loading branch information
1 parent
68f024f
commit 8ba2a79
Showing
5 changed files
with
69 additions
and
16 deletions.
There are no files selected for viewing
24 changes: 11 additions & 13 deletions
24
docs/components/content/examples/CommandPaletteExampleAsync.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
docs/components/content/examples/CommandPaletteExampleFilter.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script setup> | ||
const people = [ | ||
{ id: 1, label: 'Wade Cooper', child: true }, | ||
{ id: 2, label: 'Arlene Mccoy' }, | ||
{ id: 3, label: 'Devon Webb', child: true }, | ||
{ id: 4, label: 'Tom Cook' }, | ||
{ id: 5, label: 'Tanya Fox', child: true }, | ||
{ id: 6, label: 'Hellen Schmidt' }, | ||
{ id: 7, label: 'Caroline Schultz', child: true }, | ||
{ id: 8, label: 'Mason Heaney' }, | ||
{ id: 9, label: 'Claudie Smitham', child: true }, | ||
{ id: 10, label: 'Emil Schaefer' } | ||
] | ||
const groups = [{ | ||
key: 'users', | ||
commands: people, | ||
filter: (q, commands) => { | ||
if (!q) { | ||
return commands?.filter(command => !command.child) | ||
} | ||
return commands | ||
} | ||
}] | ||
</script> | ||
<template> | ||
<UCommandPalette :groups="groups" :autoselect="false" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8ba2a79
There was a problem hiding this comment.
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:
ui – ./
ui.nuxt.com
ui-git-dev-nuxt-js.vercel.app
ui-nuxt-js.vercel.app