mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
feat(InputMenu): allows to customize labels (#2295)
This commit is contained in:
@@ -174,6 +174,8 @@ componentProps:
|
||||
|
||||
Use the `#option-empty` slot to customize the content displayed when the `searchable` prop is `true` and there is no options. You will have access to the `query` property in the slot scope.
|
||||
|
||||
You can also configure this globally through the `ui.inputMenu.default.optionEmpty.label` config. The token `{query}` will be replaced by `query` property. Defaults to `No results for "{query}".`.
|
||||
|
||||
::component-example
|
||||
---
|
||||
component: 'input-menu-example-option-empty-slot'
|
||||
@@ -186,6 +188,8 @@ componentProps:
|
||||
|
||||
Use the `#empty` slot to customize the content displayed when there is no options. Defaults to `No options.`.
|
||||
|
||||
You can also configure this globally through the `ui.inputMenu.default.empty.label` config. Defaults to `No options.`.
|
||||
|
||||
::component-example
|
||||
---
|
||||
component: 'input-menu-example-empty-slot'
|
||||
|
||||
@@ -75,12 +75,12 @@
|
||||
|
||||
<p v-if="query && !filteredOptions.length" :class="uiMenu.option.empty">
|
||||
<slot name="option-empty" :query="query">
|
||||
No results for "{{ query }}".
|
||||
{{ uiMenu.default.optionEmpty.label.replace('{query}', query) }}
|
||||
</slot>
|
||||
</p>
|
||||
<p v-else-if="!filteredOptions.length" :class="uiMenu.empty">
|
||||
<slot name="empty" :query="query">
|
||||
No options.
|
||||
{{ uiMenu.default.empty.label }}
|
||||
</slot>
|
||||
</p>
|
||||
</HComboboxOptions>
|
||||
|
||||
@@ -53,7 +53,13 @@ export default {
|
||||
},
|
||||
default: {
|
||||
selectedIcon: 'i-heroicons-check-20-solid',
|
||||
trailingIcon: 'i-heroicons-chevron-down-20-solid'
|
||||
trailingIcon: 'i-heroicons-chevron-down-20-solid',
|
||||
empty: {
|
||||
label: 'No options.'
|
||||
},
|
||||
optionEmpty: {
|
||||
label: 'No results for "{query}".'
|
||||
}
|
||||
},
|
||||
arrow: {
|
||||
...arrow,
|
||||
|
||||
Reference in New Issue
Block a user