-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vis.js Network & Vue.js - not working properly #4622
Comments
I tried to remove Vue from your examples, and the first one still doesn't work as you expect, so I think it doesn't have anything to do with Vuejs. Can't remove 0: https://jsfiddle.net/5zfsebqt/ My guess is that vis checks for truthy-ness in the ids, because if you use a string as the id, it works, and you can remove the node: nodes: [
{ id: '0', label: '0' },
{ id: 1, label: '1' },
{ id: 2, label: '2' },
{ id: 3, label: '3' },
{ id: 4, label: '4' }
] In the second example, it does actually work when you remove Vue Updating the nodes works now: https://jsfiddle.net/oagjq7es/1/ but I'm not sure why. Hope this helps. |
Thank your for your interest in this project. However, your issue is a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide). We encourage you to ask it on the forum , Stack Overflow or on gitter and are happy to help you out there. |
@danieldiekmeier Yeah, the first example definitely has nothing to do with Vue. As for the second example - I'm also not sure why it doesn't work with Vue... without Vue everything works fine. Anyway, thanks. |
FYI, I think this is an issue with |
@wimrijnders I looked at your issue and your analysis is correct - in short, it is not recommended to put complex objects with prototypal inheritance into Vue's |
@yyx990803 Thank you very much for the confirmation, I really really appreciate it. I can use this to close off several issues we have running. I'm all for a good understanding with maintainers of other projects. I truly hope more of them are as understanding as you. TIL to always be cooperative to other maintainers. You made my day a little better; have a good one yourself! |
Temporary method,you can set Vue's |
Hi,
I am using Vis Network with Vue.js and I created two very simple applications, but none of them is working properly.
1) The first app is here: https://jsfiddle.net/Filip_Z/9k2s3dgj/4/
The problem is that it cannot delete only the first node (with id=0). All of the other nodes can be deleted.
In the browser console there are no errors.
2) The second app is here: https://jsfiddle.net/Filip_Z/3ead4r51/1/
The problem is that after applying the
setData
method, wrong labels are displayed. As you can see in the example, when you click on the button - this Vue method will be executed:So there will be three nodes but, for some reason, all these nodes will have the same label: '4'.
In the browser console there are no errors.
Now, I'm not sure where the problem is (Vue or Vis).
The text was updated successfully, but these errors were encountered: