-
Notifications
You must be signed in to change notification settings - Fork 21
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
Tree data field where path is its property #54
Comments
I'm sorry, I'm confused about what you're saying. No sort field. There is a node path variable, it is node position, can be access by scoped slot. <span slot-scope="{node, index, path, tree}">
<b>{{index}}</b>
Title: {{node.title}}
- path: <i>{{path.join(',')}}</i>
</span> Type: Array |
Sorry for not explaining too well, what I was trying to say is that I want my tree data elements to have a property where the value is the node position (node path variable you were talking about). |
tree only reads nested data, and exports nested data, like this: [{text: 'node 1'}, {text: 'node 2', children: [{text: 'node 2-1'}]}] If your data is not nested and use property to store structure, like parent_id, you need transform the data before pass into tree. |
Ok thanks, thought would be great to be able to store/save the path variable. |
May I have an example on giving the tree data let's say a
sort
field, where this field is tree component's path property?Ex. { name: "Category 1", sort: [0, 1, 1, 1] }
The text was updated successfully, but these errors were encountered: