mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-04 06:32:23 +03:00
Added resetOnOptionsChange parameter to allow changing the options of the select without resetting the value. This is extra useful for ajax request, especially slow ajax requests
This commit is contained in:
@@ -383,7 +383,16 @@
|
||||
}
|
||||
return newOption
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* When false, updating the options will not reset the select value
|
||||
* @type {Boolean}
|
||||
*/
|
||||
resetOnOptionsChange: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -402,7 +411,7 @@
|
||||
}
|
||||
},
|
||||
options() {
|
||||
if (!this.taggable) {
|
||||
if (!this.taggable && this.resetOnOptionsChange) {
|
||||
this.$set('value', this.multiple ? [] : null)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user