mirror of
https://gitee.com/antv/g6.git
synced 2024-11-30 18:58:34 +08:00
fix: xml node update state style error
This commit is contained in:
parent
51f63301ef
commit
ad2bf83bbb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user