fix: 跳过 JSExpression 并带有 events 的初始化流程

This commit is contained in:
力皓 2021-06-02 22:31:09 +08:00
parent ab45c0f255
commit 37809e71e8

View File

@ -27,7 +27,11 @@ export function initNodeReducer(props, node) {
initials.forEach(item => {
try {
// FIXME! item.name could be 'xxx.xxx'
newProps[item.name] = item.initial(node as any, newProps[item.name]);
const value = props[item.name];
// JSExpression 并且带有 events 字段属于特殊情况,不再处理
if (!(isJSExpression(value) && value.events)) {
newProps[item.name] = item.initial(node as any, newProps[item.name]);
}
} catch (e) {
if (hasOwnProperty(props, item.name)) {
newProps[item.name] = props[item.name];