Vue.D3.tree icon indicating copy to clipboard operation
Vue.D3.tree copied to clipboard

not able to add the popup for adding the child from the node and deleting node

Open surendrapaluikey opened this issue 4 years ago • 3 comments

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 ?

surendrapaluikey avatar Dec 15 '20 07:12 surendrapaluikey

Same problem, did you solve it?

dnzmsc avatar Apr 16 '21 07:04 dnzmsc

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>

MarkoArsic avatar May 26 '21 08:05 MarkoArsic

Solution Found.

use this <template slot="popUp" slot-scope="{data,node}"> instead of this <template #popUp="{data,node}">

Sakthi002 avatar Oct 14 '21 06:10 Sakthi002