0.6.7 • Published 2 years ago
vue-opti-select-light v0.6.7
vue-opti-select-light
Project setup
npm installCompiles and hot-reloads for development
npm run serveCompiles and minifies for production
npm run build-bundleLints and fixes files
npm run lintDescription
Hight performance dropdown. Tested with 1,000,000 items with lazyRender.
Props
| Name | Description |
|---|---|
| value | Key or Array of keys |
| selectFirst | Boolean default => FALSE |
| options | Array of object or Function (Server Side) |
| uniqueKey | String OR Function(option) => "String", Default "value" |
| labelKey | String OR Function(option) => "String", Default "content" |
| searchable | Boolean default => FALSE |
| searchFields | Array or Function, Default labelKey |
| searchPlaceholder | String default "Search..." |
| searchNoResultsPlaceholder | String default "No results found..." |
| debounce | Boolean default => FALSE (Search debounce) |
| debounceValue | Number default 250ms |
| groups | Array of object |
| groupBoundary | Boolean default => TRUE, Radio button case |
| groupCollapse | Boolean default => FALSE, Activate collapse group |
| collapsed | Boolean default => FALSE, Default collapsed state |
| buttonType | String default "placeholder", options => "filter", "static", "tag" |
| tagLimit | Number default => 50 ( Used when buttonType is "tag" ) |
| buttonNoCaret | Boolean default => FALSE |
| buttonBlock | Boolean default => FALSE |
| buttonSize | String default => "sm" |
| optionType | String default "text", options => "radio", "checkbox" |
| buttonPlaceholder | String default "Select Option" |
| buttonPlaceholderAllSelected | String default "" |
| buttonPlaceholderMultiple | Function({ count, suffix }) => ${count} item${suffix} selected |
| single | Boolean default => FALSE |
| lazy | Boolean default => FALSE |
| lazyRender | Boolean default => FALSE |
| emitOnClick | Boolean default => FALSE |
| disabled | Boolean default => FALSE |
| prevent | Boolean default => FALSE (Prevent from selecting) |
Slots
| Name | Description |
|---|---|
| BUTTON_PLACEHOLDER | slot-scope="{ options, option }" |
| TAG | slot-scope="{ option, remove }" |
| TAG_LABEL | slot-scope="{ option }" |
| HEADER | |
| HEADER_2 | Slot after search |
| FOOTER | |
| GROUP_BEFORE | slot-scope="{ group }" |
| GROUPBEFOREname | slot-scope="{ group }" |
| GROUP | slot-scope="{ group, selectAllFiltered, unselectAllFiltered }" |
| GROUP_name | slot-scope="{ group, selectAllFiltered, unselectAllFiltered }" |
| GROUP_AFTER | slot-scope="{ group }" |
| GROUPAFTERname | slot-scope="{ group }" |
| ITEM | slot-scope="{ option }" |
| ITEM_name | slot-scope="{ option }" |
| ITEMBEFOREname | slot-scope="{ option }" |
| ITEMAFTERname | slot-scope="{ option }" |
| SEARCH_NO_RESULTS |
Events
| Name | Description |
|---|---|
| @input | Function(Array) |
| @update | Function(Array), Exec when updated from v-model |
| @click | Function({Object}, Boolean) |
| @change | Function(Array), Exec when hidden |
| @shown | Dropdown shown |
| @hidden | Dropdown hidden |
Methods
| Name | Description |
|---|---|
| add() | Function(String or Array of keys) |
| remove() | Function(String or Array of keys) |
| selectAll() | Select All |
| clear() | UnSelect All |
| show() | Open dropdown |
| hide() | Hide dropdown |
| resetOptions() | Reset Server-Side options |
vee-validate 2.*
| Prop | Description |
|---|---|
| data-vv-value-path | "$c_model" (optional) |
| data-vv-validate-on | "input|update" |
// Example vee-validate 2.*
<vue-opti-select-light
:class="[{ 'has-error': $_hasError('field3') === false }, 'w-100']"
data-vv-as="Campaign Type"
v-validate="'required'"
data-vv-validate-on="input|update"
data-vv-value-path="$c_model"
name="field3"
:value="row.field3 && row.field3.to && row.field3.to.value ? row.field3.to.value.key : null"
@change="(option) => { row.field3.to = option; $_changeFieldTo(row, item); }"
:options="$c_fieldsToOptions"
:groups="optionsData.fieldsGroup"
:unique-key="option => option.value.key"
label-key="text"
single
searchable
button-block
/>Todo!
- Lazy Render groups support
0.6.7
2 years ago
0.6.6
2 years ago
0.6.5
4 years ago
0.6.4
4 years ago
0.6.3
5 years ago
0.6.2
5 years ago
0.6.1
5 years ago
0.6.0
5 years ago
0.5.2
5 years ago
0.5.1
5 years ago
0.5.0
5 years ago
0.4.14
5 years ago
0.4.13
5 years ago
0.4.12
5 years ago
0.4.10
5 years ago
0.4.11
5 years ago
0.4.9
5 years ago
0.4.8
5 years ago
0.4.7
5 years ago
0.4.6
5 years ago
0.4.5
5 years ago
0.4.4
5 years ago
0.4.3
5 years ago
0.4.2
5 years ago
0.4.1
5 years ago
0.4.0
5 years ago
0.3.14
5 years ago
0.3.13
5 years ago
0.3.12
5 years ago
0.3.11
5 years ago
0.3.10
5 years ago
0.3.9
5 years ago
0.3.8
5 years ago
0.3.6
5 years ago
0.3.7
5 years ago
0.3.0
6 years ago
0.3.5
5 years ago
0.3.2
6 years ago
0.3.1
6 years ago
0.3.4
5 years ago
0.3.3
5 years ago
0.2.0
6 years ago
0.1.8
6 years ago
0.1.9
6 years ago
0.1.7
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago