2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00

Add loadingText and noMatchText.

This commit is contained in:
meteorlxy
2017-08-26 21:51:03 +00:00
parent afca6bf11c
commit da811e5313
+25 -6
View File
@@ -298,7 +298,7 @@
<i v-if="!noDrop" ref="openIndicator" role="presentation" class="open-indicator"></i> <i v-if="!noDrop" ref="openIndicator" role="presentation" class="open-indicator"></i>
<slot name="spinner"> <slot name="spinner">
<div class="spinner" v-show="mutableLoading">Loading...</div> <div class="spinner" v-show="mutableLoading">{{ loadingText }}</div>
</slot> </slot>
</div> </div>
@@ -310,7 +310,7 @@
</a> </a>
</li> </li>
<li v-if="!filteredOptions.length" class="no-options"> <li v-if="!filteredOptions.length" class="no-options">
<slot name="no-options">Sorry, no matching options.</slot> <slot name="no-options">{{ noMatchText }}</slot>
</li> </li>
</ul> </ul>
</transition> </transition>
@@ -341,7 +341,7 @@
* If you are using an array of objects, vue-select will look for * If you are using an array of objects, vue-select will look for
* a `label` key (ex. [{label: 'This is Foo', value: 'foo'}]). A * a `label` key (ex. [{label: 'This is Foo', value: 'foo'}]). A
* custom label key can be set with the `label` prop. * custom label key can be set with the `label` prop.
* @type {Object} * @type {Array}
*/ */
options: { options: {
type: Array, type: Array,
@@ -371,7 +371,7 @@
/** /**
* Equivalent to the `multiple` attribute on a `<select>` input. * Equivalent to the `multiple` attribute on a `<select>` input.
* @type {Object} * @type {Boolean}
*/ */
multiple: { multiple: {
type: Boolean, type: Boolean,
@@ -380,13 +380,31 @@
/** /**
* Equivalent to the `placeholder` attribute on an `<input>`. * Equivalent to the `placeholder` attribute on an `<input>`.
* @type {Object} * @type {String}
*/ */
placeholder: { placeholder: {
type: String, type: String,
default: '' default: ''
}, },
/**
* Text to show if there is no matching options
* @type {String}
*/
noMatchText: {
type: String,
default: 'Sorry, no matching options.'
},
/**
* Text to show when loading
* @type {String}
*/
loadingText: {
type: String,
default: 'Loading...'
},
/** /**
* Sets a Vue transition property on the `.dropdown-menu`. vue-select * Sets a Vue transition property on the `.dropdown-menu`. vue-select
* does not include CSS for transitions, you'll need to add them yourself. * does not include CSS for transitions, you'll need to add them yourself.
@@ -429,6 +447,7 @@
/** /**
* Callback to generate the label text. If {option} * Callback to generate the label text. If {option}
* is an object, returns option[this.label] by default. * is an object, returns option[this.label] by default.
* @type {Function}
* @param {Object || String} option * @param {Object || String} option
* @return {String} * @return {String}
*/ */
@@ -449,7 +468,7 @@
* value(s) change. When integrating with Vuex, use this callback to trigger * value(s) change. When integrating with Vuex, use this callback to trigger
* an action, rather than using :value.sync to retreive the selected value. * an action, rather than using :value.sync to retreive the selected value.
* @type {Function} * @type {Function}
* @default {null} * @param {Object || String} val
*/ */
onChange: { onChange: {
type: Function, type: Function,