holiber/sl-vue-tree

Expand tree by clicking title

Closed this issue · 1 comments

is there a way of expanding the node by clicking the title?

You can handle your own events in the title slot:

<sl-vue-tree v-model="nodes">
    <template slot="title" slot-scope="{ node }">

      <div class="my-custom-title" @click="expandNode(node)">
        {{ node.title }}
      </div>
      
    </template>
</sl-vue-tree>
expandNode(node) {
  this.refs.slVueTree.updateNode(node.path, { isExpanded: true });
}