mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-02 13:17:57 +01:00
fix(SelectCustom): improve creatable placeholder
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ComboboxOption>
|
</ComboboxOption>
|
||||||
|
|
||||||
<ComboboxOption v-if="queryOption" v-slot="{ active, selected }" :value="queryOption" as="template">
|
<ComboboxOption v-if="creatable && queryOption && !filteredOptions.length" v-slot="{ active, selected }" :value="queryOption" as="template">
|
||||||
<li :class="resolveOptionClass({ active, selected })">
|
<li :class="resolveOptionClass({ active, selected })">
|
||||||
<div :class="listOptionContainerClass">
|
<div :class="listOptionContainerClass">
|
||||||
<slot name="option-create" :option="queryOption" :active="active" :selected="selected">
|
<slot name="option-create" :option="queryOption" :active="active" :selected="selected">
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ComboboxOption>
|
</ComboboxOption>
|
||||||
<p v-else-if="searchable && query" :class="listOptionEmptyClass">
|
<p v-else-if="searchable && query && !filteredOptions.length" :class="listOptionEmptyClass">
|
||||||
<slot name="option-empty" :query="query">
|
<slot name="option-empty" :query="query">
|
||||||
No results found for "{{ query }}".
|
No results found for "{{ query }}".
|
||||||
</slot>
|
</slot>
|
||||||
@@ -306,13 +306,6 @@ const filteredOptions = computed(() =>
|
|||||||
)
|
)
|
||||||
|
|
||||||
const queryOption = computed(() => {
|
const queryOption = computed(() => {
|
||||||
if (!props.creatable) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
if (!query.value) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return query.value === '' ? null : { [props.textAttribute]: query.value }
|
return query.value === '' ? null : { [props.textAttribute]: query.value }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user