From 3344c19e3c6a560b564add250dbb81057bd5abe5 Mon Sep 17 00:00:00 2001 From: Jeff Sagal Date: Wed, 1 Jun 2016 10:28:31 -0700 Subject: [PATCH] initial idea --- src/components/Select.vue | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/components/Select.vue b/src/components/Select.vue index 0e216c8..34a8a1b 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -264,6 +264,29 @@ default: 'label' }, + /** + * + */ + getOptionLabel: { + type: Function, + + /** + * Generate the option label text. If {option} + * is an object, return option[this.label]. + * + * @param {Object || String} option + * @return {String} + */ + 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 @@ -423,22 +446,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; - }, - /** * Move the typeAheadPointer visually up the list by * subtracting the current index by one.