Skip to content

Commit

Permalink
fix(select): fix state.selected.state is empty object, and can't get …
Browse files Browse the repository at this point in the history
…the right displayText
  • Loading branch information
shenjunjian committed Feb 14, 2025
1 parent 4989269 commit 73f2b88
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/renderless/src/select/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,7 @@ const initState = ({ reactive, computed, props, api, emitter, parent, constants,
const find = props.options.find((opt) => opt[props.valueField] === state.selected.value)
return find ? find[props.textField] : ''
} else {
return (
(state.selected.state
? state.selected.state.currentLabel
: state.selected.currentLabel || state.selected.label) || ''
)
return state.selected.state?.currentLabel || state.selected.currentLabel || state.selected.label || ''
}
} else {
return ''
Expand Down

0 comments on commit 73f2b88

Please sign in to comment.