import React, { Fragment } from 'react';
import { RegisterNode } from 'gg-editor';
class EditorCustomNode extends React.Component {
render() {
const config = {
draw(item) {
const group = item.getGraphicGroup();
const model = item.getModel();
const keyShape = group.addShape('path', {
attrs: {
path: this.getPath(model), // 根据配置获取路径
stroke: '#40a9ff', // 颜色应用到描边上,如果应用到填充,则使用 fill: model.color
fill: '#e6f7ff'
},
name: 'path-shape',
// 设置 draggable 以允许响应鼠标的图拽事件
draggable: false
});
if (model.label) {
// 如果有文本
group.addShape('text', {
attrs: {
react使用gg-editor自定义脑图节点
最新推荐文章于 2022-10-20 17:26:18 发布