Vuetify Drag And Drop Draggable Tree View Component | v-treeview

vuetify-draggable-treeview is a tree view component of the Vuetify framework that allows the user to reorder parent and child nodes by dragging and dropping.

mui draggable treeview, vuetify treeview example, vue treeview expand all, mui draggable list, vuetify draggable

How to make use of it:

Install and download:

# Yarn
$ yarn add vuedraggable

# NPM
$ npm i vuedraggable --save

1. Install and import the component.

import VuetifyDraggableTreeview from 'vuetify-draggable-treeview'
Vue.use(VuetifyDraggableTreeview)

2. Add the draggable tree view component to the template.

<template>
  <v-draggable-treeview
    group="example"
    v-model="items"
  ></v-draggable-treeview>
</template>

3. Add nodes to the tree view.

export default {
  data() {
    return {
      items: [{ id: 1, name: "node-1", children: [{ id:11, name: "node1-1" }] }]
    }
  }
}

API

Currently, this component dose not support all original v-treeview component’s props, slots, event.

Props

NameTypeDefaultDescription
valueObject[]items for treeview. item-keyitem-textitem-children are not customizable currently. value can be like { id: 1, name: "test", children: []} .
groupstringnullgroup name for vuedraggable. If this props not provided, drag and drop are enabled only in children.
expand-iconstring‘mdi-menu-down’mdi string for the expand icon.

Events

NameValueDescription
inputarrayEmits the array of selected items when this value changes

Slots

NamePropsDescription
append{ item: any, open: boolean }Appends content after label
label{ item: any, open: boolean }Label content
prepend{ item: any, open: boolean }Prepends content before label

Draggable Tree View, vuetify-draggable-treeview Plugin/Github


See Demo And Download

Official Website(suusan2go): Click Here

This superior jQuery/javascript plugin is developed by suusan2go. For extra Advanced Usage, please go to the official website.

Share