fix: xml node update state style error

This commit is contained in:
多牧 2020-06-24 11:15:38 +08:00 committed by Moyee
parent 51f63301ef
commit ad2bf83bbb

View File

@ -475,13 +475,10 @@ export function createNodeFromXML(gen: string | ((node: any) => string)) {
return keyshape;
},
setState(name, value, node) {
const cfg = node.get('model') || {};
const cfg = Object.assign({}, node.get('model') || {});
// 根据状态构造style
if (value && cfg.style && cfg.style[name]) {
cfg.originStyle = cfg.style;
cfg.style = { ...cfg.style, ...cfg.style[name] }
} else if (cfg.originStyle) {
cfg.style = cfg.originStyle;
}
// 根据上下文更新
this.update(cfg, node);