Skip to content

Commit

Permalink
fix(ele): select preview-text error when use datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
lala2333 committed Jan 21, 2025
1 parent a0f3169 commit e20312d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/element/src/preview-text/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ const Select = observer(
const fieldRef = useField<Field>()
const field = fieldRef.value
const props = attrs as unknown as SelectProps
const dataSource: any[] = field?.dataSource?.length
? field.dataSource
: props?.options?.length
? props.options
: []
const placeholder = usePlaceholder()
const getSelected = () => {
const value = props.value
Expand All @@ -86,6 +81,11 @@ const Select = observer(

const getLabels = () => {
const selected = getSelected()
const dataSource: any[] = field?.dataSource?.length
? field.dataSource
: props?.options?.length
? props.options
: []
if (!selected.length) {
return h(
Tag,
Expand Down

0 comments on commit e20312d

Please sign in to comment.