2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

bump readme

This commit is contained in:
Jeff Sagal
2016-05-28 14:56:52 -07:00
parent 75c9032d70
commit b64969aee3
+126 -108
View File
@@ -4,16 +4,17 @@
#### Features #### Features
- No Dependencies - **Tagging Support (+v.1.1.0)**
- No JS Dependencies
- List Filtering/Searching - List Filtering/Searching
- Supports Vuex - Supports Vuex
- Select Single/Multiple Options - Select Single/Multiple Options
- Bootstrap Friendly Classes - Bootstrap Friendly Markup
- Excellent Test Coverage - +90% Test Coverage
#### Upcoming/In Progress #### Upcoming/In Progress
- Tagging (adding options not present in list, see `taggable` branch) - ~~Tagging (adding options not present in list, see `taggable` branch)~~ **added in v.1.1.0**
- Rich Option Templating - Rich Option Templating
- Asyncronous Option Loading - Asyncronous Option Loading
@@ -48,120 +49,137 @@ export default {
## Parameters ## Parameters
```javascript ```javascript
/** /**
* Contains the currently selected value. Very similar to a * Contains the currently selected value. Very similar to a
* `value` attribute on an &amp;lt;input&amp;gt;. In most cases, you'll want * `value` attribute on an <input>. In most cases, you'll want
* to set this as a two-way binding, using :value.sync. However, * to set this as a two-way binding, using :value.sync. However,
* this will not work with Vuex, in which case you'll need to use * this will not work with Vuex, in which case you'll need to use
* the onChange callback property. * the onChange callback property.
* @type {Object||String||null} * @type {Object||String||null}
*/ */
value: { value: {
default: null default: null
}, },
/** /**
* An array of strings or objects to be used as dropdown choices. * An array of strings or objects to be used as dropdown choices.
* 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 {Array} * @type {Object}
*/ */
options: { options: {
type: Array, type: Array,
default() { return [] }, default() { return [] },
}, },
/** /**
* Enable/disable filtering the options. * Sets the max-height property on the dropdown list.
* @type {Boolean} * @deprecated
*/ * @type {String}
searchable: { */
type: Boolean, maxHeight: {
default: true type: String,
}, default: '400px'
},
/** /**
* Equivalent to the `multiple` attribute on a `&lt;select&gt;` input. * Enable/disable filtering the options.
* @type {Object} * @type {Boolean}
*/ */
multiple: { searchable: {
type: Boolean, type: Boolean,
default: false default: true
}, },
/** /**
* Equivalent to the `placeholder` attribute on an `&lt;input&gt;`. * Equivalent to the `multiple` attribute on a `<select>` input.
* @type {Object} * @type {Object}
*/ */
placeholder: { multiple: {
type: String, type: Boolean,
default: '' default: false
}, },
/** /**
* Sets a Vue transition property on the `.dropdown-menu`. vue-select * Equivalent to the `placeholder` attribute on an `<input>`.
* does not include CSS for transitions, you'll need to add them yourself. * @type {Object}
* @type {String} */
*/ placeholder: {
transition: { type: String,
type: String, default: ''
default: 'expand' },
},
/** /**
* Enables/disables clearing the search text when an option is selected. * Sets a Vue transition property on the `.dropdown-menu`. vue-select
* @type {Boolean} * does not include CSS for transitions, you'll need to add them yourself.
*/ * @type {String}
clearSearchOnSelect: { */
type: Boolean, transition: {
default: true type: String,
}, default: 'expand'
},
/** /**
* Tells vue-select what key to use when generating option labels when * Enables/disables clearing the search text when an option is selected.
* `option` is an object. * @type {Boolean}
* @type {Object} */
*/ clearSearchOnSelect: {
label: { type: Boolean,
type: String, default: true
default: 'label' },
},
/** /**
* An optional callback function that is called each time the selected * Tells vue-select what key to use when generating option
* value(s) change. When integrating with Vuex, use this callback to trigger * labels when each `option` is an object.
* an action, rather than using :value.sync to retreive the selected value. * @type {String}
* @type {[type]} */
*/ label: {
onChange: Function, type: String,
default: 'label'
},
/** /**
* Enable/disable creating options from searchInput. * An optional callback function that is called each time the selected
* @type {Boolean} * value(s) change. When integrating with Vuex, use this callback to trigger
*/ * an action, rather than using :value.sync to retreive the selected value.
tagable: { * @type {Function}
type: Boolean, * @default {null}
default: false */
}, onChange: Function,
/** /**
* User defined function for adding Options * Enable/disable creating options from searchInput.
* @type {Function} * @type {Boolean}
*/ */
createOption: { taggable: {
type: Function, type: Boolean,
default: function (value) { default: false
let firstOption = this.options[0] },
if (firstOption && typeof firstOption === 'object' ) {
value = { /**
value * When true, newly created tags will be added to
} * the options list.
value[this.label] = value * @type {Boolean}
} */
return value pushTags: {
} type: Boolean,
} default: false
},
/**
* User defined function for adding Options
* @type {Function}
*/
createOption: {
type: Function,
default: function (newOption) {
if (typeof this.options[0] === 'object') {
return {[this.label]: newOption}
}
return newOption
}
}
``` ```