1.3.2 • Published 4 years ago

vue-org-shi v1.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

vue-org-shi

A simple organization tree chart based on Vue2.x

基于vue2-org-tree 更改了less语法,此插件使用了sass,修复IE11不兼容问题

Usage

NPM

# use npm
npm i vue-org-shi

# use yarn
yarn add vue-org-shi

Import Plugins

import Vue from 'vue'
import Vue2OrgTree from 'vue-org-shi'

Vue.use(Vue2OrgTree)

// ...

CDN

API

  • props

propdescriptontypedefault
dataObject
propsconfigure propsObject{label: 'label', children: 'children', expand: 'expand'}
labelWidthnode label widthString | Numberauto
collapsablechildren node is collapsableBooleantrue
renderContenthow to render node labelFunction-
labelClassNamenode label classFunction | String-
selectedKeyThe key of the selected nodeString-
selectedClassNameThe className of the selected nodeFunction | String-
  • events

    event namedescriptontype
    clickClick eventFunction
    mouseoveronMouseOver eventFunction
    mouseoutonMouseOut eventFunction
  • Call events

on-expand

well be called when the collapse-btn clicked

  • params e Event
  • params data Current node data

on-node-click

well be called when the node-label clicked

  • params e Event
  • params data Current node data

on-node-mouseover

It is called when the mouse hovers over the label.

  • params e Event
  • params data Current node data

on-node-mouseout

It is called when the mouse leaves the label.

  • params e Event
  • params data Current node data

Example

  • default

    default

  • horizontal

    horizontal

Browser support

use table layout!

IE9+、Chrome、Firefox、Opera

License

MIT

1.3.2

4 years ago

1.3.1

4 years ago