fix: 兼容没有 prototype 的情况

This commit is contained in:
力皓 2021-05-20 17:13:20 +08:00
parent 57ae82453a
commit e442436440

View File

@ -79,7 +79,7 @@ editor?.on('history.forward', (data) => {
function triggerUseVariableChange(data: any) {
const { node, prop, oldValue, newValue } = data;
const propConfig = node.componentMeta.prototype.options.configure.find((o: any) => o.name === prop.getKey());
const propConfig = node.componentMeta.prototype?.options.configure.find((o: any) => o.name === prop.getKey());
if (!propConfig?.useVariableChange) return;
if (isJSExpression(oldValue) && !isJSExpression(newValue)) {
propConfig.useVariableChange.call(prop, { isUseVariable: false });