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

Adding custom data or objects on node

pvrsouza opened this issue · comments

is it possible to create custom fields to store extra information? For example:

...
children: [
{
    text: "Custom Data",
    selected: false,
    children: [
        {
            text: "Incluir",
            disabled: true,
            customdata: {
                url: "http://someurl.com"
            }
        },
    ],
    customdata: {
                url: "http://someurl.com"
            }
    }
]

And I would like it to be possible to have access to this information at events, like this:

...
methods: {
    itemClick(node, item, e) {
      console.log(item.customdata.url); //or node.customdata.url
    }
  },...