wfd-vue icon indicating copy to clipboard operation
wfd-vue copied to clipboard

更新g6版本后(4.26),不能连线了

Open zhanghui-space opened this issue 3 years ago • 10 comments

https://user-images.githubusercontent.com/42032734/114842313-50a8ca00-9e0b-11eb-80be-687c8b3ffcdd.mov

鼠标移到锚点时,此时触发了onNodeLeave事件,恰好把锚点remove了 active 状态不能作用了 求大佬指点

// hoverNodeActived.js
 onNodeLeave(e){
     if(!(e.target instanceof Marker) && !this.graph.get('edgeDragging')) {
       this.graph.setItemState(e.item, 'show-anchor', false);
     }
   }
// hoverAnchorActived.js
  onAnchorEnter(e){
     if(!this.graph.get('edgeDragging'))
       this.graph.setItemState(e.item, 'active-anchor', true);
   }

zhanghui-space avatar Apr 15 '21 09:04 zhanghui-space

e.target instanceof Marker不能用了,你换成别的判断

guozhaolong avatar Apr 19 '21 02:04 guozhaolong

感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave

zhanghui-space avatar Apr 19 '21 02:04 zhanghui-space

感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave

大佬,修改哪个文件?怎么改的有代码吗?

guanpenghui1993 avatar Oct 15 '21 03:10 guanpenghui1993

@gzhanghui 老哥,请教下,更新至4.1以上版本以后

shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js 中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢?

直接 import Item from '@antv/g6 不能用, shapeBase 也没有。

谢谢。

gotounix avatar Apr 29 '22 08:04 gotounix

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

guanpenghui1993 avatar Apr 29 '22 08:04 guanpenghui1993

@gzhanghui老哥,请教下,更新至4.1以上版本以后

shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢?

直接import Item from '@antv/g6不能用,shapeBase 也没有。

谢谢。 可以稍微看一下g6的目录解构 import { shapeBase } from '@antv/g6-core/lib/element/shapeBase'; import Shape from '@antv/g6-core/lib/element/shape';

zhanghui-space avatar May 06 '22 03:05 zhanghui-space

@gzhanghui 感谢,已解决。

gotounix avatar May 09 '22 14:05 gotounix

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

guanpenghui1993 avatar Aug 30 '22 09:08 guanpenghui1993

shapeBase

@gzhanghui老哥,请教下,更新至4.1以上版本以后 shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢? 直接import Item from '@antv/g6不能用,shapeBase 也没有。 谢谢。 可以稍微看一下g6的目录解构 import { shapeBase } from '@antv/g6-core/lib/element/shapeBase'; import Shape from '@antv/g6-core/lib/element/shape';

 // package.json
 
   "dependencies": {

    "@antv/dom-util": "2.0.2",
    "@antv/g-canvas": "^0.4.12",
    "@antv/g6": "^4.2.6",
    "@antv/g6-core": "^0.2.6",
    "@antv/util": "~2.0.9",

    }
import { shapeBase } from '@antv/g6-core/lib/element/shapeBase';

zhanghui-space avatar Aug 30 '22 11:08 zhanghui-space

大佬好,请教个问题: 两个节点连线时,报如下错误信息 image

报错位置:dragEdge.js 下的 dragEdgeBeforeShowAnchor() 和 _clearAllAnchor() 该如何解决?

huangtangtang avatar Aug 30 '22 16:08 huangtangtang