2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

docs(resetOnOptionsChange): add versioning info (#1020)

* docs(resetOnOptionsChange): update documentation

Related #1015

* docs(resetOnOptionsChange): add versioning info
This commit is contained in:
Jeff Sagal
2019-12-02 13:30:52 -08:00
committed by GitHub
parent 582a0f0fac
commit 3f5872c3fc
2 changed files with 9 additions and 4 deletions
+5 -3
View File
@@ -339,9 +339,11 @@ createOption: {
## resetOnOptionsChange
When false, updating the options will not reset the selected value. Accepts
a `boolean` or `function` that returns a `boolean`. If defined as a function,
it will receive the params listed below.
When false, updating the options will not reset the selected value.
Since `v3.4+` the prop accepts either a `boolean` or `function` that returns a `boolean`.
If defined as a function, it will receive the params listed below.
```js
/**
+4 -1
View File
@@ -412,6 +412,9 @@
* When false, updating the options will not reset the selected value. Accepts
* a `boolean` or `function` that returns a `boolean`. If defined as a function,
* it will receive the params listed below.
*
* @since 3.4 - Type changed to {Boolean|Function}
*
* @type {Boolean|Function}
* @param {Array} newOptions
* @param {Array} oldOptions
@@ -522,7 +525,7 @@
let shouldReset = () => typeof this.resetOnOptionsChange === 'function'
? this.resetOnOptionsChange(newOptions, oldOptions, this.selectedValue)
: this.resetOnOptionsChange;
if (!this.taggable && shouldReset()) {
this.clearSelection();
}