2
0
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:
Blaine Ehrhart
2016-06-20 16:17:00 -07:00
parent 883d318c4b
commit 361aba64d9
3 changed files with 67 additions and 8 deletions
+11 -2
View File
@@ -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)
}
},