From e20312d8d2127d8a041ca1105d9e35a1a305b10c Mon Sep 17 00:00:00 2001 From: lala2333 <953716500@qq.com> Date: Tue, 21 Jan 2025 17:39:11 +0800 Subject: [PATCH] fix(ele): select preview-text error when use datasource --- packages/element/src/preview-text/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/element/src/preview-text/index.ts b/packages/element/src/preview-text/index.ts index c6a90160be8..e2e2ab884f8 100644 --- a/packages/element/src/preview-text/index.ts +++ b/packages/element/src/preview-text/index.ts @@ -67,11 +67,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 @@ -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,