2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00
Files
Tiago Roldão 6e1c0dbcbd feat: option selection events (#1324)
- `option:selecting` before state is set
- `option:selected` after state is set
- `option:deselecting` before state is set
- `option:deselected` after state is set

Co-authored-by: tiagoroldao <troldao@assurehedge.com>
Co-authored-by: Jeff <sagalbot@gmail.com>
2020-12-18 12:18:34 -08:00

1.5 KiB

input

Triggered when the selected value changes. Used internally for v-model.

/**
 * @param val {Object|String}` - selected option.
 */
this.$emit("input", val);

option:selecting

Triggered after an option has been selected, before updating internal state.

this.$emit("option:selecting", selectedOption);

option:selected

Triggered when an option has been selected, after updating internal state.

this.$emit("option:selected", selectedOption);

option:deselecting

Triggered when an option has been deselected, before updating internal state.

this.$emit("option:deselecting", selectedOption);

option:deselected

Triggered when an option has been deselected, after updating internal state.

this.$emit("option:deselected", deselectedOption);

option:created

Triggered when taggable is true and a new option has been created.

/**
 * @param newOption {Object} - created option
 */
this.$emit("option:created", newOption);

search:blur

Triggered when the text input loses focus. The dropdown will close immediately before this event is triggered.

this.$emit("search:blur");

search:focus

Triggered when the text input gains focus. The dropdown will open immediately before this event is triggered.

this.$emit("search:focus");