Fixed #6773 - Provide showEmptyMessage for AutoComplete
parent
486261ec1f
commit
12f2b71122
|
@ -513,6 +513,11 @@ export interface AutoCompleteProps {
|
|||
* @defaultValue No results found
|
||||
*/
|
||||
emptySearchMessage?: string | undefined;
|
||||
/**
|
||||
* When enabled, empty search message will be visible.
|
||||
* @defaultValue true
|
||||
*/
|
||||
showEmptyMessage?: boolean | undefined;
|
||||
/**
|
||||
* Index of the element in tabbing order.
|
||||
*/
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
<slot name="option" :option="option" :index="getOptionIndex(i, getItemOptions)">{{ getOptionLabel(option) }}</slot>
|
||||
</li>
|
||||
</template>
|
||||
<li v-if="!items || (items && items.length === 0)" :class="cx('emptyMessage')" role="option" v-bind="ptm('emptyMessage')">
|
||||
<li v-if="showEmptyMessage && (!items || (items && items.length === 0))" :class="cx('emptyMessage')" role="option" v-bind="ptm('emptyMessage')">
|
||||
<slot name="empty">{{ searchResultMessageText }}</slot>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -150,6 +150,10 @@ export default {
|
|||
type: String,
|
||||
default: null
|
||||
},
|
||||
showEmptyMessage: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
tabindex: {
|
||||
type: Number,
|
||||
default: 0
|
||||
|
|
Loading…
Reference in New Issue