zdy1988 / vue-jstree

A Tree Plugin For Vue2.0+

Home Page:http://zdy1988.github.io/vue-jstree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get node item in itemEvents ?

granty1 opened this issue · comments

commented

Hello, I want to customize the email menu, but how can I get the right-click node object in the customized event? In addition, do I have other methods to get the top-level Vue object? The current $parent method is not very friendly.

itemEvents: {
        contextmenu: function() {
          let e = arguments[2];
          console.log(arguments);
          arguments[2].preventDefault();
          let that =
            arguments[0].$parent.$parent.$parent.$parent.$parent.$parent.$parent
              .$parent.$parent.$parent.$parent.$parent.$parent.$parent.$parent
              .$parent;
          that.left = 100;
          that.left = e.clientX - 20;
          that.top = e.clientY - 100;
          that.contextMenuVisible = true;
          // tree node operation 
        },