diff --git a/packages/components/src/preview-text/index.ts b/packages/components/src/preview-text/index.ts index 288b40d..ab3ac6c 100644 --- a/packages/components/src/preview-text/index.ts +++ b/packages/components/src/preview-text/index.ts @@ -48,11 +48,6 @@ const Select = observer( const fieldRef = useField() 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 @@ -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,