feat(CommandPalette): handle filter attribute in groups (#871)

This commit is contained in:
Benjamin Canac
2023-10-26 11:59:55 +02:00
committed by GitHub
parent 68f024f742
commit 8ba2a791e4
5 changed files with 70 additions and 17 deletions

View File

@@ -183,6 +183,19 @@ componentProps:
The `loading` state will automatically be enabled when a `search` function is loading. You can disable this behavior by setting the `loading-icon` prop to `null` or globally in `ui.commandPalette.default.loadingIcon`.
::
## Filter search
You can also pass a function to the `filter` property of a group to filter displayed commands after the search happened. The function will receive the query as its first argument, the array of commands as second argument and should return an array of commands.
::component-example
---
padding: false
component: 'command-palette-example-filter'
componentProps:
class: 'h-[274px]'
---
::
## Slots
### `<group>-icon`