我正在使用试用版的Rappid JS,它在bpmn编辑器中具有带有默认选项的模具。我需要在列表中添加新元素,这样我就可以使用它并附加与它相关的检查器表单。
下面是我尝试过的代码。这是POC实现Rappid所必需的。
bpmn.js
stencil.load([
new joint.shapes.bpmn.Gateway,
new joint.shapes.bpmn.Activity,
.
.
new joint,shapes.bpmn.myStencil
]);
inpector.js
window.inputs = {
'bpmn.Gateway': {
.
.
},
.
.
'bpmn.myStencil':{
//same as in-built Gateway code
}
};
错误显示:
joint.shapes.bpmn.myStencil不是构造器。
发布于 2017-08-09 11:29:00
我在bpmn.js中使用下面的代码完成了它:
joint.shapes.basic.Rect = joint.shapes.basic.Generic.extend({
markup: '<g class="rotatable"><g class="scalable"><rect class="body"/></g><text class="label"/></g>',
defaults: joint.util.deepSupplement({
type: 'basic.Rect',
attrs: {
'rect': { fill: 'white', stroke: 'black', 'follow-scale': true, width: 80, height: 40 },
".label":{text:"",ref:".body","ref-x":.5,"ref-dy":20,"y-alignment":"middle","x-alignment":"middle","font-size":14,"font-family":"Arial, helvetica, sans-serif",fill:"#000000"},
'text': { 'font-size': 14, 'ref-x': .5, 'ref-y': .5, ref: 'rect', 'y-alignment': 'middle', 'x-alignment': 'middle' }
}
}, joint.shapes.basic.Generic.prototype.defaults)
});
https://stackoverflow.com/questions/45583705
复制相似问题