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

Merge branch 'master' into mixins

# Conflicts:
#	src/components/Select.vue
#	src/mixins/pointerScroll.js
This commit is contained in:
Jeff Sagal
2016-06-03 11:00:25 -07:00
7 changed files with 35 additions and 32 deletions
+20 -18
View File
@@ -138,8 +138,8 @@
v-model="search"
@keydown.delete="maybeDeleteValue"
@keyup.esc="onEscape"
@keyup.up.prevent="typeAheadUp"
@keyup.down.prevent="typeAheadDown"
@keydown.up.prevent="typeAheadUp"
@keydown.down.prevent="typeAheadDown"
@keyup.enter.prevent="typeAheadSelect"
@blur="open = false"
@focus="open = true"
@@ -265,6 +265,24 @@
default: 'label'
},
/**
* Callback to generate the label text. If {option}
* is an object, returns option[this.label] by default.
* @param {Object || String} option
* @return {String}
*/
getOptionLabel: {
type: Function,
default(option) {
if( typeof option === 'object' ) {
if( this.label && option[this.label] ) {
return option[this.label]
}
}
return option;
}
},
/**
* An optional callback function that is called each time the selected
* value(s) change. When integrating with Vuex, use this callback to trigger
@@ -419,22 +437,6 @@
return this.value === option
},
/**
* Generate the option label text. If {option}
* is an object, return option[this.label].
*
* @param {Object || String} option
* @return {String}
*/
getOptionLabel( option ) {
if( typeof option === 'object' ) {
if( this.label && option[this.label] ) {
return option[this.label]
}
}
return option;
},
/**
* If there is any text in the search input, remove it.
* Otherwise, blur the search input to close the dropdown.