diff --git a/packages/editor-preset-vision/src/editor.ts b/packages/editor-preset-vision/src/editor.ts index 0bf3c4627..45a9938db 100644 --- a/packages/editor-preset-vision/src/editor.ts +++ b/packages/editor-preset-vision/src/editor.ts @@ -152,7 +152,7 @@ function compatiableReducer(props: any) { } } // 为了能降级到老版本,建议在后期版本去掉以下代码 - if (isJSExpression(val)) { + if (isJSExpression(val) && !val.events) { val = { type: 'variable', value: val.mock, diff --git a/packages/types/src/value-type.ts b/packages/types/src/value-type.ts index dd6e48f18..6e5083c0a 100644 --- a/packages/types/src/value-type.ts +++ b/packages/types/src/value-type.ts @@ -11,6 +11,10 @@ export interface JSExpression { * 模拟值 */ mock?: any; + /** + * 额外扩展属性,如 extType、events + */ + [key: string]: any; } export interface JSSlot {