0
我有一些问题在图上隐含了fromJson和toJson方法。当我下载json时,我个人端口上的自定义数据属性也出现在json文件中。但是当我尝试从下载的json上载它时,它会完全重置并清除我的端口选项。有什么办法可以改变这种行为吗?JointJS devs从json更新图形时端口数据会失望
由于提前, 笨得
我有一些问题在图上隐含了fromJson和toJson方法。当我下载json时,我个人端口上的自定义数据属性也出现在json文件中。但是当我尝试从下载的json上载它时,它会完全重置并清除我的端口选项。有什么办法可以改变这种行为吗?JointJS devs从json更新图形时端口数据会失望
由于提前, 笨得
面临similiar问题。
在我的情况下,我扩展了devs.Model形状。它是一个特定的形状,它通过引入保持端口的inPorts和outPorts数组属性来简化当前的端口API。 那些失踪。
为了解决这个问题,您应该从例如basic.Generic形状而不是devs.Model。
我从
return joint.shapes.devs.Model.extend({
markup: [
].join(''),
defaults: joint.util.deepSupplement({
type: 'devs.GenericModel',
attrs: {},
ports: {},
}, joint.shapes.devs.Model.prototype.defaults)
});
改为
return joint.shapes.basic.Generic.extend({
markup: [
].join(''),
defaults: joint.util.deepSupplement({
type: 'devs.GenericModel',
attrs: {},
ports: {},
}, joint.shapes.basic.Generic.prototype.defaults)
});
希望它能够解决您的问题:)
面临着类似的问题。有人找到解决方案吗? – shubhamkes