提交 | 用户 | 时间
|
820397
|
1 |
import BpmnRenderer from 'bpmn-js/lib/draw/BpmnRenderer' |
H |
2 |
|
|
3 |
export default function CustomRenderer(config, eventBus, styles, pathMap, canvas, textRenderer) { |
|
4 |
BpmnRenderer.call(this, config, eventBus, styles, pathMap, canvas, textRenderer, 2000) |
|
5 |
|
|
6 |
this.handlers['label'] = function () { |
|
7 |
return null |
|
8 |
} |
|
9 |
} |
|
10 |
|
|
11 |
const F = function () {} // 核心,利用空对象作为中介; |
|
12 |
F.prototype = BpmnRenderer.prototype // 核心,将父类的原型赋值给空对象F; |
|
13 |
CustomRenderer.prototype = new F() // 核心,将 F的实例赋值给子类; |
|
14 |
CustomRenderer.prototype.constructor = CustomRenderer // 修复子类CustomRenderer的构造器指向,防止原型链的混乱; |