0
如何在joint.shapes.uml
中使用循环。我不知道可以或不可以使用它。在JointJs中使用循环
var uml = joint.shapes.uml;
var classes = {
@Model.Entity[0]: new uml.Class({
position: { x: 30, y: 40 },
size: { width: 200, height: 220 },
name: '@Model.Entity[0]',
attributes: ['@Model.Column'],
methods: [],
attrs: {
'.uml-class-name-rect': {
fill: 'white',
stroke: 'black',
'stroke-width': 2,
},
'.uml-class-attrs-rect, .uml-class-methods-rect': {
fill: 'white',
stroke: 'black',
'stroke-width': 2,
},
}
}),
@Model.Entity[1]: new uml.Class({
position: { x: 624, y: 103 },
size: { width: 200, height: 150 },
name: '@Model.Entity[1]',
attributes: ['DeptName', '...', 'Etc.'],
methods: [],
attrs: {
'.uml-class-name-rect': {
fill: 'white',
stroke: 'black',
'stroke-width': 2,
},
'.uml-class-attrs-rect, .uml-class-methods-rect': {
fill: 'white',
stroke: 'black',
'stroke-width': 2,
},
},
})
};
graph.addCells(classes);
谢谢。