sailing-vuetree
v0.1.10
Published
基于vue3的树形组件
Readme
vue-tree
Usage
<template>
<vue-tree :model="mockData"></vue-tree>
</template>
<script lang="ts" setup>
import { getTreeData, VueTree } from "sailing-vuetree";
import type {
ITreeNodeInstance,
TreeNodeData,
} from "sailing-vuetree/lib/typings";
const mockTree: Array<TreeNodeData> = [
{
name: "Node 1",
id: 1,
pid: 0,
children: [
{
name: "Node 1-2",
id: 2,
pid: 1,
},
],
},
{
name: "Node 2",
id: 3,
pid: 0,
disabled: true,
},
{
name: "Node 3",
id: 4,
pid: 0,
},
];
const treeInstance: ITreeNodeInstance = getTreeData(mockTree);
const mockData = reactive(treeInstance);
</script>API
Installation
npm install vue-treeProject setup
pnpm installCompiles and hot-reloads for development
pnpm run serveCompiles and minifies for production
pnpm run buildLints and fixes files
pnpm run lintCustomize configuration
Update the API section of README.md with generated documentation
npm run doc:buildRun style guide dev server
npm run styleguideGenerate a static HTML style guide
npm run styleguide:build