guozhaolong / wfd-vue

flowable workflow designer for Vue base on @antv/g6
https://guozhaolong.github.io/wfd-vue/
1.01k stars 264 forks source link

锚点处添加描述信息 #5

Open gzhanghui opened 4 years ago

gzhanghui commented 4 years ago

想在锚点处添加描述信息,自己在createAnchor方法中尝试,好像只能添加一个节点的,请教一下有什么好的解决方法吗

function  createAnchor(index,style,group) {
  const anchorContainer = group.addGroup();
  const anchor = new Item({
  // ......
  });
  //  .......
  anchor.showHotpot = function () {
    hotpot = anchorContainer.addShape('marker', {
      attrs: {
        ...style,
        ...editorStyle.anchorHotsoptStyle,
        isInAnchor:style.y < 0
      }
    });
    anchorContainer.addShape('text', {
      attrs: {
        id: 111,
        x:  style.x,
        y:  style.y - 20,
        textAlign: 'center',
        textBaseline: 'middle',
        text: 'hello',
        fill: '#333333'
      }
    });
 }
 return anchorContainer;
// ........
}
guozhaolong commented 4 years ago

是不是你这个id写了个固定的111造成的啊?