From e6f2b6866d2927e16d7779ac7921358e565c8f73 Mon Sep 17 00:00:00 2001 From: wibetter <365533093@qq.com> Date: Tue, 2 Apr 2024 12:23:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(amis-core):=20autovar=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E6=89=A7=E8=A1=8CresolveVariableAnd?= =?UTF-8?q?Filter=E5=89=8D=E5=85=88=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=BA=E8=A1=A8=E8=BE=BE=E5=BC=8F=EF=BC=8C=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=8D=9F=E8=80=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-core/src/SchemaRenderer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/amis-core/src/SchemaRenderer.tsx b/packages/amis-core/src/SchemaRenderer.tsx index 557a99b6a..67994cff1 100644 --- a/packages/amis-core/src/SchemaRenderer.tsx +++ b/packages/amis-core/src/SchemaRenderer.tsx @@ -23,6 +23,7 @@ import {isAlive} from 'mobx-state-tree'; import {reaction} from 'mobx'; import {resolveVariableAndFilter} from './utils/tpl-builtin'; import {buildStyle} from './utils/style'; +import {isExpression} from './utils/formula'; import {StatusScopedProps} from './StatusScoped'; import {evalExpression, filter} from './utils/tpl'; @@ -491,7 +492,7 @@ export class SchemaRenderer extends React.Component { // 自动解析变量模式,主要是方便直接引入第三方组件库,无需为了支持变量封装一层 if (renderer.autoVar) { for (const key of Object.keys(schema)) { - if (typeof props[key] === 'string') { + if (typeof props[key] === 'string' && isExpression(props[key])) { props[key] = resolveVariableAndFilter( props[key], props.data,