Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Mind 绑定点击事件报错 #6

Closed
zxgjwy0216 opened this issue Nov 13, 2019 · 10 comments
Closed

Mind 绑定点击事件报错 #6

zxgjwy0216 opened this issue Nov 13, 2019 · 10 comments
Labels
bug Something isn't working

Comments

@zxgjwy0216
Copy link

      <mind :data="mockData" :onNodeClick="handleNodeClick" :graph="{ mode: 'readOnly' }"
       />

这个语句报错了,在flow中是不会报错的。
index.js?4579:32 Uncaught (in promise) TypeError: target.on is not a function
at VueComponent.addListener (index.js?4579:32)
at eval (index.js?14e4:43)
at Array.forEach ()
at VueComponent.bindEvent (index.js?14e4:39)
希望大佬能坚持下去,这个玩意很重要非常感谢哈哈哈,感觉你可以开个群

@zxgjwy0216 zxgjwy0216 added the bug Something isn't working label Nov 13, 2019
@ChrisShen93
Copy link
Owner

@zxgjwy0216

麻烦提供一下vue、vg-editor 的版本号

@zxgjwy0216
Copy link
Author

我是clone你这个项目直接跑的, vg是2.7.1 Vue是2.6.10

@zxgjwy0216
Copy link
Author

解决了,大佬应该是改的时候没改全,到 src/components/Mind/index中把重复的bindEvent方法删除就可以了

@ChrisShen93
Copy link
Owner

@zxgjwy0216

解决了,大佬应该是改的时候没改全,到 src/components/Mind/index中把重复的bindEvent方法删除就可以了

这里是因为对于mind来说,bindEvent需要额外注册一些其他的事件

本issue提到的问题已经修复,今晚十一点左右发 v2.7.2 的包

感谢支持

@ChrisShen93
Copy link
Owner

@zxgjwy0216

btw,给脑图增加事件时,请勿设置 mode: readOnly

@zxgjwy0216
Copy link
Author

了解,感谢大佬回复,顺便一问,我现在已经自己注册了一个RegisterNode,如何像GGeditor一样设置firstSubShape,secondSubShape为我自己自定义的样式呢

@ChrisShen93
Copy link
Owner

了解,感谢大佬回复,顺便一问,我现在已经自己注册了一个RegisterNode,如何像GGeditor一样设置firstSubShape,secondSubShape为我自己自定义的样式呢

开一个新的issue,lable为feature吧。之前没做这个功能

其实GGEditor功能还有不少我没移植过来,主要是因为我做这个是为了自己的一个业务,所以文档看得不够仔细(虽然我也没找到比如firstSubShape的相关文档)

React不需要显式声明props,因此也有不少功能光看它的代码也不容易看出来。。。

@ChrisShen93
Copy link
Owner

@zxgjwy0216

开了一个需求收集的issue

@zxgjwy0216
Copy link
Author

好的,这个周末会整理一下比较通用的需求,我也会努力为VGEditor的完善贡献力量的

@ChrisShen93
Copy link
Owner

fixed in pr

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants