wfd-vue
wfd-vue copied to clipboard
更新g6版本后(4.26),不能连线了
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);
}
e.target instanceof Marker不能用了,你换成别的判断
感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave
感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave
大佬,修改哪个文件?怎么改的有代码吗?
@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
也没有。
谢谢。
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
@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';
@gzhanghui 感谢,已解决。
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
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';
大佬好,请教个问题: 两个节点连线时,报如下错误信息
报错位置:dragEdge.js 下的 dragEdgeBeforeShowAnchor() 和 _clearAllAnchor() 该如何解决?