mirror of https://github.com/ElemeFE/element
Select: fix priority of label and value
parent
807c06071d
commit
2f37355136
|
@ -50,6 +50,10 @@
|
||||||
return this.label || ((typeof this.value === 'string' || typeof this.value === 'number') ? this.value : '');
|
return this.label || ((typeof this.value === 'string' || typeof this.value === 'number') ? this.value : '');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
currentValue() {
|
||||||
|
return this.value || this.label || '';
|
||||||
|
},
|
||||||
|
|
||||||
parent() {
|
parent() {
|
||||||
let result = this.$parent;
|
let result = this.$parent;
|
||||||
while (!result.isSelect) {
|
while (!result.isSelect) {
|
||||||
|
|
|
@ -421,7 +421,7 @@
|
||||||
} else {
|
} else {
|
||||||
let optionIndex = -1;
|
let optionIndex = -1;
|
||||||
this.selected.forEach((item, index) => {
|
this.selected.forEach((item, index) => {
|
||||||
if (item === option || item.currentLabel === option.currentLabel) {
|
if (item === option || item.currentValue === option.currentValue) {
|
||||||
optionIndex = index;
|
optionIndex = index;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue