Skip to content

Commit da811e5

Browse files
committed
Add loadingText and noMatchText.
1 parent afca6bf commit da811e5

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/components/Select.vue

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
<i v-if="!noDrop" ref="openIndicator" role="presentation" class="open-indicator"></i>
299299

300300
<slot name="spinner">
301-
<div class="spinner" v-show="mutableLoading">Loading...</div>
301+
<div class="spinner" v-show="mutableLoading">{{ loadingText }}</div>
302302
</slot>
303303
</div>
304304

@@ -310,7 +310,7 @@
310310
</a>
311311
</li>
312312
<li v-if="!filteredOptions.length" class="no-options">
313-
<slot name="no-options">Sorry, no matching options.</slot>
313+
<slot name="no-options">{{ noMatchText }}</slot>
314314
</li>
315315
</ul>
316316
</transition>
@@ -341,7 +341,7 @@
341341
* If you are using an array of objects, vue-select will look for
342342
* a `label` key (ex. [{label: 'This is Foo', value: 'foo'}]). A
343343
* custom label key can be set with the `label` prop.
344-
* @type {Object}
344+
* @type {Array}
345345
*/
346346
options: {
347347
type: Array,
@@ -371,7 +371,7 @@
371371
372372
/**
373373
* Equivalent to the `multiple` attribute on a `<select>` input.
374-
* @type {Object}
374+
* @type {Boolean}
375375
*/
376376
multiple: {
377377
type: Boolean,
@@ -380,13 +380,31 @@
380380
381381
/**
382382
* Equivalent to the `placeholder` attribute on an `<input>`.
383-
* @type {Object}
383+
* @type {String}
384384
*/
385385
placeholder: {
386386
type: String,
387387
default: ''
388388
},
389389
390+
/**
391+
* Text to show if there is no matching options
392+
* @type {String}
393+
*/
394+
noMatchText: {
395+
type: String,
396+
default: 'Sorry, no matching options.'
397+
},
398+
399+
/**
400+
* Text to show when loading
401+
* @type {String}
402+
*/
403+
loadingText: {
404+
type: String,
405+
default: 'Loading...'
406+
},
407+
390408
/**
391409
* Sets a Vue transition property on the `.dropdown-menu`. vue-select
392410
* does not include CSS for transitions, you'll need to add them yourself.
@@ -429,6 +447,7 @@
429447
/**
430448
* Callback to generate the label text. If {option}
431449
* is an object, returns option[this.label] by default.
450+
* @type {Function}
432451
* @param {Object || String} option
433452
* @return {String}
434453
*/
@@ -449,7 +468,7 @@
449468
* value(s) change. When integrating with Vuex, use this callback to trigger
450469
* an action, rather than using :value.sync to retreive the selected value.
451470
* @type {Function}
452-
* @default {null}
471+
* @param {Object || String} val
453472
*/
454473
onChange: {
455474
type: Function,

0 commit comments

Comments
 (0)