Use label first if available
This commit is contained in:
parent
4cccdf1fd5
commit
1b39f56967
2 changed files with 3 additions and 2 deletions
|
@ -58,7 +58,7 @@
|
|||
return (this.label) ? this.label : this.value;
|
||||
},
|
||||
optionLabel(){
|
||||
return (this.$el && this.$el.textContent) || this.label;
|
||||
return this.label || (this.$el && this.$el.textContent);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -129,9 +129,10 @@
|
|||
};
|
||||
|
||||
const getOptionLabel = option => {
|
||||
if (option.componentOptions.propsData.label) return option.componentOptions.propsData.label;
|
||||
const textContent = (option.componentOptions.children || []).reduce((str, child) => str + (child.text || ''), '');
|
||||
const innerHTML = getNestedProperty(option, 'data.domProps.innerHTML');
|
||||
return option.componentOptions.propsData.label || textContent || (typeof innerHTML === 'string' ? innerHTML : '');
|
||||
return textContent || (typeof innerHTML === 'string' ? innerHTML : '');
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue