|
| 1 | +--- |
| 2 | +title: Props |
| 3 | +--- |
| 4 | + |
| 5 | +## multiple |
| 6 | + |
| 7 | +Equivalent to the multiple attribute on a `<select>` input. |
| 8 | + |
| 9 | +```js |
| 10 | +multiple: { default: false, type: Boolean }, |
| 11 | +``` |
| 12 | + |
| 13 | +## placeholder |
| 14 | + |
| 15 | +Equivalent to the placeholder attribute on a `<input>` input. |
| 16 | + |
| 17 | +```js |
| 18 | +placeholder: { default: '', type: String }, |
| 19 | +``` |
| 20 | + |
| 21 | +## options |
| 22 | + |
| 23 | +An array of strings or objects to be used as dropdown choices. |
| 24 | +If you are using an array of objects, vue-selectize will look for a `id` and `label` key |
| 25 | +Ex. `[{id: 'MZ', label: 'Mozambique'}]` |
| 26 | +A custom label key can be set with the [label](#label) prop. |
| 27 | + |
| 28 | +```js |
| 29 | +options: { default: () => [], type: Array }, |
| 30 | +``` |
| 31 | + |
| 32 | +## keyBy |
| 33 | + |
| 34 | +Selectable option unique identifier key, each option must have a unique identifier. |
| 35 | +Use this prop to change the default behavior |
| 36 | + |
| 37 | +```js |
| 38 | +keyBy: { default: 'id', type: String }, |
| 39 | +``` |
| 40 | + |
| 41 | +## label |
| 42 | + |
| 43 | +Tells vue-selectize what key to use when generating option labels when each option |
| 44 | +is an object. |
| 45 | + |
| 46 | +```js |
| 47 | +label: { default: 'label', type: String }, |
| 48 | +``` |
| 49 | + |
| 50 | +## keys |
| 51 | + |
| 52 | +vue-selectize internaly uses fuse.js to perform its search capabilities, this props tells |
| 53 | +witch keys to use for searching. |
| 54 | + |
| 55 | +```js |
| 56 | +keys: { default: () => ['label'] }, |
| 57 | +``` |
| 58 | + |
| 59 | +## value |
| 60 | + |
| 61 | +Contains the currently selected value. Very similar to a value attribute on an `<input>`. You can listen for changes |
| 62 | +using `input` event using v-on |
| 63 | + |
| 64 | +```js |
| 65 | +value: { default: null, type: [Array, Object, String, Number] }, |
| 66 | +``` |
| 67 | + |
| 68 | +## limit |
| 69 | + |
| 70 | +The limits the number of options that are visible in the dropdown |
| 71 | + |
| 72 | +```js |
| 73 | +limit: { default: 0, type: [Number] }, |
| 74 | +``` |
| 75 | + |
| 76 | +## disabled |
| 77 | + |
| 78 | +Disable the entire component. |
| 79 | + |
| 80 | +```js |
| 81 | +disabled: { default: false, type: Boolean }, |
| 82 | +``` |
| 83 | + |
| 84 | +## disableSearch |
| 85 | + |
| 86 | +Disable the built in search engine |
| 87 | + |
| 88 | +```js |
| 89 | +disableSearch: { default: false, type: Boolean }, |
| 90 | +``` |
| 91 | + |
| 92 | +## createItem |
| 93 | + |
| 94 | +User defined function for adding Options. Set to false to disable adding option |
| 95 | + |
| 96 | +```js |
| 97 | +createItem: { |
| 98 | + default: function(text) { |
| 99 | + return Promise.resolve(text) |
| 100 | + }, |
| 101 | + type: [Function, Boolean] |
| 102 | +}, |
| 103 | +``` |
| 104 | + |
| 105 | +## searchFn |
| 106 | + |
| 107 | +User defined function for searching |
| 108 | + |
| 109 | +```js |
| 110 | +searchFn: { default: false, type: [Boolean, Function] }, |
| 111 | +``` |
| 112 | + |
| 113 | +## theme |
| 114 | + |
| 115 | +Selectize.js theme |
| 116 | + |
| 117 | +```js |
| 118 | +theme: { default: '', type: String } |
| 119 | +``` |
| 120 | + |
| 121 | + |
0 commit comments