Vue.D3.tree
Vue.D3.tree copied to clipboard
not able to add the popup for adding the child from the node and deleting node
I have used the slot in this format but whenever I click on the text of the node it won't pop up.
code :
<tree :data="data" layoutType="horizontal" :radius="10" > <template #popUp="{data,node}"> <div class="btn-group-vertical"> <button @click="addFor(data)"> <i class="fa fa-plus" aria-hidden="false"></i> </button> <button @click="remove(data, node)"> <i class="fa fa-trash" aria-hidden="false"></i> </button> </div> </template> </tree>
any suggestion ?
Same problem, did you solve it?
This works for me,
<tree :data="tree" node-text="name" layoutType="vertical" type="tree" :duration="700" linkLayout="bezier" :zoomable="true" :minZoom="0.01" :maxZoom="35" :radius="6" > <template #popUp="{data,node}"> <div> <q-btn color="primary" outline @click="addNode(data)" icon="add_circle_outline" /> <q-btn color="negative" outline @click="removeNode(data, node)" icon="remove_circle_outline" /> </div> </template> </tree>
Solution Found.
use this <template slot="popUp" slot-scope="{data,node}">
instead of this <template #popUp="{data,node}">