Commit 1cd7dd8b3d9205e3f924ed51487535f28461c7b0
Committed by
GitHub
Merge pull request #3742 from SergioCrisostomo/select-patches
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 | ... | ... |