Skip to content

Commit

Permalink
fix: fix select preview label text (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxinyong authored Feb 10, 2022
1 parent aecd483 commit a7f4d5f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/components/src/preview-text/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,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 @@ -73,6 +68,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 a7f4d5f

Please sign in to comment.