-
Notifications
You must be signed in to change notification settings - Fork 60
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
How to click the node to get the data of each node in the development scenario #61
Comments
Tree(:data="data" draggable crossTree)
div(slot-scope="{data, store, vm}" @click="yourmethod(data)")
//- data is node
//- store is the tree
//- vm is node Vue instance, you can get node level by vm.level
template(v-if="!data.isDragPlaceHolder")
b(v-if="data.children && data.children.length" @click="store.toggleOpen(data)") {{data.open ? '-' : '+'}}
span {{data.text}} |
thank you I see 😄 |
那个 添加了@click="yourmethod(data)" 获取当前节点数据 时 我想解析当前节点的数据 但是该对象 还在遍历循环中 控制台报错:Uncaught TypeError: Converting circular structure to JSON |
// with children
div(slot-scope="{data, store, vm}" @click="yourmethod(store.pure(data, true))")
// without children
div(slot-scope="{data, store, vm}" @click="yourmethod(store.pure(data))") |
ok, you are good! |
Tree events change Event the third parameter oldTree returns null and does not fetch the oldTree structure |
old tree exists when drag cross tree |
What kind of situation is the existence of the old tree can not try out |
https://github.com/phphe/vue-draggable-nested-tree/blob/master/src/components/DraggableTreeNode.vue#L61 |
O I see |
So let's say I want to click and get the data for each node how do I extend that by just adding the click event
The text was updated successfully, but these errors were encountered: