Commit 1b39f56967c7eac1a548d557accc230f3e039d42
1 parent
4cccdf1f
Use label first if available
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
src/components/select/option.vue
src/components/select/select.vue
... | ... | @@ -129,9 +129,10 @@ |
129 | 129 | }; |
130 | 130 | |
131 | 131 | const getOptionLabel = option => { |
132 | + if (option.componentOptions.propsData.label) return option.componentOptions.propsData.label; | |
132 | 133 | const textContent = (option.componentOptions.children || []).reduce((str, child) => str + (child.text || ''), ''); |
133 | 134 | const innerHTML = getNestedProperty(option, 'data.domProps.innerHTML'); |
134 | - return option.componentOptions.propsData.label || textContent || (typeof innerHTML === 'string' ? innerHTML : ''); | |
135 | + return textContent || (typeof innerHTML === 'string' ? innerHTML : ''); | |
135 | 136 | }; |
136 | 137 | |
137 | 138 | ... | ... |