Socket
Socket
Sign inDemoInstall

vue-treeselect

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-treeselect

a tree select plugin for vue2


Version published
Maintainers
1
Created
Source

vue-treeselect

npm

Introduction

A tree plugin for vue2

This Plugin is based on vue-jstree, Some "props" can be used for reference !

DEMO

http://zdy1988.github.io/vue-treeselect

NPM

    npm install vue-treeselect

ES6

    import VTreeselect from 'vue-treeselect'
    
    new Vue({
      components: {
        VTreeselect
      }
    })

Setup

    npm install
    npm run dev

Usage

    <v-tree-select :data="data" value-field-name="id" v-model="selectItem"></v-tree-select>
    
      new Vue({
        el: '#app',
        data: {
          data: [
            {
              "id": 1,
              "text": "Same but with checkboxes",
              "children": [
                {
                  "id": 2,
                  "text": "initially selected",
                },
                {
                  "id": 3,
                  "text": "custom icon",
                },
                {
                  "id": 4,
                  "text": "initially open",
                  "children": [
                    {
                      "id": 5,
                      "text": "Another node"
                    }
                  ]
                },
                {
                  "id": 6,
                  "text": "custom icon",
                },
                {
                  "id": 7,
                  "text": "disabled node",
                  "disabled": true
                }
              ]
            },
            {
              "id": 8,
              "text": "Same but with checkboxes",
              "children": [
                {
                  "id": 9,
                  "text": "initially selected",
                },
                {
                  "id": 10,
                  "text": "custom icon",
                },
                {
                  "id": 11,
                  "text": "initially open",
                  "children": [
                    {
                      "id": 12,
                      "text": "Another node"
                    }
                  ]
                },
                {
                  "id": 13,
                  "text": "custom icon",
                },
                {
                  "id": 14,
                  "text": "disabled node",
                  "disabled": true
                }
              ]
            },
            {
              "id": 15,
              "text": "And wholerow selection"
            }
          ],
          selectItem: null
        }
      })

API

PropsTypeDefaultDescribe
placeholderStringset placeholder
dataArrayset tree data
sizeStringset tree item size , value : 'large' or '' or ''small'
show-checkboxBooleanfalseset it show checkbox
allow-transitionBooleantrueallow use transition animation
whole-rowBooleanfalseuse whole row state
no-dotsBooleanfalseshow or hide dots
multipleBooleanfalseset multiple selected tree item
allow-batchBooleanfalsein multiple choices. allow batch select
text-field-nameString'text'set tree item display field
value-field-nameString'value'set tree item value field
children-field-nameString'children'set tree item children field
asyncFunctionasync load callback function , if node is a leaf ,you can set 'isLeaf: true' in data
loading-textString'Loading'set loading text
klassStringset append tree class

Data Item Optional Properties

NameTypeDefaultDescribe
iconStringcustom icon css class
openedBooleanfalseset leaf opened
selectedBooleanfalseset node selected
disabledBooleanfalseset node disabled
isLeafBooleanfalseif node is a leaf , set true can hide '+'

Keywords

FAQs

Package last updated on 28 Apr 2018

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc