-
zhangwei
3 天以前 89b94f3cc1aa492b3223b97f3312d8eca004032b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { RectNode, RectNodeModel, h } from "@logicflow/core";
 
class TaskNode extends RectNode {
    getShare() {
        const { model } = this.props;
        const { width, height, x, y } = model;
        const position = {
            x: x - width / 2,
            y: y - height / 2,
        }
        const style = model.getNodeStyle();
        return h('rect', { ...style, ...position });
    }
}
class TaskNodeModel extends RectNodeModel {
    constructor(data, graphModel) {
        super(data, graphModel);
        this.radius = 20;
    }
}
export default {
    type: 'task-node',
    view: TaskNode,
    model: TaskNodeModel,
}