mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
fix: 修复 JSFunction 表达式使用时,无法去掉 this 使用 scope 变量
This commit is contained in:
parent
de5d0650df
commit
38389cf5b8
@ -712,7 +712,7 @@ export default function baseRenererFactory() {
|
||||
) {
|
||||
return checkProps(props);
|
||||
}
|
||||
if (isJSExpression(props)) {
|
||||
if (isJSExpression(props) || isJSFunction(props)) {
|
||||
props = parseExpression(props, scope);
|
||||
// 只有当变量解析出来为模型结构的时候才会继续解析
|
||||
if (!isSchema(props) && !isJSSlot(props)) return checkProps(props);
|
||||
|
||||
@ -412,7 +412,7 @@ export function parseData(schema: any, self: any): any {
|
||||
return schema;
|
||||
}
|
||||
|
||||
/* 全匹配{{开头,}}结尾的变量表达式,或者对象类型JSExpression,支持省略this */
|
||||
/* 全匹配{{开头,}}结尾的变量表达式,或者对象类型JSExpression/JSFunction,支持省略this */
|
||||
export function parseExpression(str: any, self: any) {
|
||||
try {
|
||||
const contextArr = ['"use strict";', 'var __self = arguments[0];'];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user