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