Select: fix priority of label and value

pull/1369/head
kingwl 2016-11-25 14:06:53 +08:00 committed by 杨奕
parent 807c06071d
commit 2f37355136
2 changed files with 5 additions and 1 deletions

View File

@ -50,6 +50,10 @@
return this.label || ((typeof this.value === 'string' || typeof this.value === 'number') ? this.value : '');
},
currentValue() {
return this.value || this.label || '';
},
parent() {
let result = this.$parent;
while (!result.isSelect) {

View File

@ -421,7 +421,7 @@
} else {
let optionIndex = -1;
this.selected.forEach((item, index) => {
if (item === option || item.currentLabel === option.currentLabel) {
if (item === option || item.currentValue === option.currentValue) {
optionIndex = index;
}
});