Socket
Book a DemoInstallSign in
Socket

group-tree-list

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

group-tree-list

tree list with drag and drop rename

1.0.5
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

A treeview component for Bootstrap and Vue.js 2.0+

Bootstrap-Vue-Treeview Screenshot

Online demo

https://bootstrap-vue-treeview.appdiamond.pl

Features

  • Drag & drop nodes
  • Context menu

Installation

npm install --save bootstrap-vue-treeview

Getting started

Webpack

If you use Webpack bundler (recommended) you can import component and register it locally:

import { bTreeView } from 'bootstrap-vue-treeview'
[...]
components: {
	bTreeView
},

or globally using plugin:

import BootstrapVueTreeview from 'bootstrap-vue-treeview'
Vue.use(BootstrapVueTreeview)

Now you can you the treeview component in your code:

<b-tree-view :data="treeData"></b-tree-view>
export default {
  data() {
    return {
      treeData: [{"id": 2, "name": "Venus" , "children": [{"id": 3, "name": "Neptune"}, {"id": 4, "name": "Stratus"} ] } ]
    }
  }
}

API

TreeView

1. Vue props

PropTypeDescriptionDefault valueRequired
dataArrayTree data-Yes
nodeKeyPropStringName of the property containing unique node key"id"No
nodeChildrenPropStringWhere to look for node children"children"No
nodeLabelPropStringName of the property containing node label"name"No
showIconsBooleanShow/hide iconsfalseNo
iconClassPropStringName of the property containing icon class"icon"No
defaultIconClassStringIcon class to apply if node has no icon class propertynullNo
prependIconClassStringClass to apply to every icon (common to all icons)nullNo
nodesDraggableBooleanEnable/disable drag & drop featurefalseNo
contextMenuBooleanEnable/disable context menutrueNo
renameNodeOnDblClickBooleanEnable/disable double click to rename featuretrueNo
contextMenuItemsArray of menu itemsContext menu items[ { code: 'DELETE_NODE', label: 'Delete node' }, { code: 'RENAME_NODE', label: 'Rename node' } ]No

2. Events

Event nameDescriptionParameters
nodeSelectTriggered every time a node is selected/deselected. Check second parameter to verify if the node was selected or deselectedTreeNode object, isSelected
contextMenuItemSelectTriggered every time a context menu item was clicked.Context menu item object (see below), TreeNode object

TreeNode

Props and events of the tree node component are not intended to be used directly.

1. Methods

Method nameDescriptionParameters
selectSelect node-
deselectDeselect node-
expandExpand node (show children)-
collapseCollapse node (hide children)-
toggleExpand/collapse-

Menu item

1. Properties

PropertyDescription
codeCode of the menu item. Check this code to know which menu item was clicked.
labelLabel being displayed for the user

Keywords

treelist

FAQs

Package last updated on 22 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.