phphe / vue-draggable-nested-tree

Vue2 draggable tree component
https://hetree.phphe.com/
MIT License
344 stars 62 forks source link

Is it support hierarchical table? #54

Closed huiyang closed 5 years ago

huiyang commented 5 years ago

Seem like it do not support the hierarchical table as it use nested ?

I will need to display my records in table as it have many columns of data, is there any solution for this?

Thanks.

phphe commented 5 years ago

I don't know your needs. Could you give more information? pic, code or demo

huiyang commented 5 years ago

I need to do something like this: It is multiple level, and draggable, also, it is in a table, so that i can put button, or other information in each line

image

Thanks.

phphe commented 5 years ago

that is easy. there is a button for every node in below example:

Tree(:data="data" draggable crossTree)
  div(slot-scope="{data, store, vm}")
    //- 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}}
      button your button
huiyang commented 5 years ago

but this is not in a table, the button is not aligned

phphe commented 5 years ago

it don't support hierarchical table. you can use css to align it.

huiyang commented 5 years ago

Oh, alright, thanks.