code refactoring
This commit is contained in:
parent
83dd72d20b
commit
3089935262
@ -327,6 +327,7 @@ export default {
|
|||||||
new_options: {},
|
new_options: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
remote: false,
|
remote: false,
|
||||||
|
selected_is_compiled: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -362,7 +363,6 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
// Check Here..
|
// Check Here..
|
||||||
this.selected = this.value;
|
this.selected = this.value;
|
||||||
|
|
||||||
if (this.model.length) {
|
if (this.model.length) {
|
||||||
try {
|
try {
|
||||||
if (eval(this.model) !== undefined) {
|
if (eval(this.model) !== undefined) {
|
||||||
@ -383,6 +383,7 @@ export default {
|
|||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
this.change();
|
this.change();
|
||||||
|
this.selected_is_compiled = true;
|
||||||
}.bind(this), 800);
|
}.bind(this), 800);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -943,7 +944,11 @@ export default {
|
|||||||
this.selected = selected.toString();
|
this.selected = selected.toString();
|
||||||
} else {
|
} else {
|
||||||
if (Array.isArray(this.selected) && !this.selected.length) {
|
if (Array.isArray(this.selected) && !this.selected.length) {
|
||||||
|
if (! this.selected_is_compiled) {
|
||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
|
} else {
|
||||||
|
this.selected = [];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let is_string = false;
|
let is_string = false;
|
||||||
let pre_value = [];
|
let pre_value = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user