@ken_yuan/pure-tree

0.1.3 • Public • Published

pure-tree

A Vue tree component using pure css to implement fold and expand

Usage

<template>
  <div id="app">
    <tree :root="top"></tree>
  </div>
</template>

<script>
  import tree from '@ken_yuan/pure-tree'
  import '@ken_yuan/pure-tree/dist/pure-tree.css'

  export default {
    name: 'app',
    components: {
      tree
    },
    data() {
      return {
        top: {
          key: "a",
          value: "a",
          children: [{
            key: "b",
            value: "b",
            children: [{
              key: "d",
              value: "d"
            }, {
              key: "e",
              value: "e"
            }]
          }, {
            key: "c",
            value: "c"
          }]
        }
      }
    }
  }
</script>

Readme

Keywords

Package Sidebar

Install

npm i @ken_yuan/pure-tree

Weekly Downloads

1

Version

0.1.3

License

none

Unpacked Size

103 kB

Total Files

10

Last publish

Collaborators

  • ken_yuan