docs(SelectMenu): improve async search example

This commit is contained in:
Benjamin Canac
2024-01-05 17:29:47 +01:00
parent 5d781112f1
commit e4b8fffc32
2 changed files with 25 additions and 17 deletions

View File

@@ -132,6 +132,18 @@ props:
---
::
### Control the query :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"}
Use a `v-model:query` to control the search query.
::component-example
---
component: 'select-menu-example-search-query'
componentProps:
class: 'w-full lg:w-48'
---
::
### Async search
Pass a function to the `searchable` prop to customize the search behavior and filter options according to your needs. The function will receive the query as its first argument and should return an array.
@@ -140,19 +152,7 @@ Use the `debounce` prop to adjust the delay of the function.
::component-example
---
component: 'select-menu-example-async-search'
componentProps:
class: 'w-full lg:w-48'
---
::
### Control the query :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"}
Use a `v-model:query` to control the search query.
::component-example
---
component: 'select-menu-example-search-query'
component: 'select-menu-example-search-async'
componentProps:
class: 'w-full lg:w-48'
---