source

git:vue-tree-right
npm:vue-tree-right

vue-tree-right

Usage

npm install vue-tree-right
1.import TreeRight from "vue-tree-right"
2.components: {
    TreeRight,
  }
3.list: [//datasource
        {
          id: "z1",
          name: "leglo",
          age: "18",
          gender: "男",
          work: "web",
          children: [
            {
              name: "leglo1",
              age: "18",
              gender: "男",
              work: "web",
              id: "z1-1",
              children: [
                {
                  name: "leglo1-1",
                  age: "18",
                  gender: "男",
                  work: "web",
                  id: "z1-1-1",
                  children: [
                    {
                      name: "leglo1-1-1",
                      age: "18",
                      gender: "男",
                      work: "web",
                      id: "z1-1-1",
                    },
                  ],
                },
                {
                  id: "z1-1-2",
                  name: "leglo1-2",
                  age: "18",
                  gender: "男",
                  work: "web",
                },
                {
                  id: "z1-1-3",
                  name: "leglo1-3",
                  age: "18",
                  gender: "男",
                  work: "web",
                },
                {
                  id: "z1-1-4",
                  name: "leglo1-4",
                  age: "18",
                  gender: "男",
                  work: "web",
                },
              ],
            },
            {
              name: "leglo2",
              id: "z1-2",
              age: "18",
              gender: "男",
              work: "web",
            },
          ],
        },
      ],
      showFields: [//show fields
        {
          name: "姓名:",
          key: "name",
        },
        {
          name: "年龄:",
          key: "age",
        },
      ],
      
4.    <TreeRight :list="list" :showfields="showFields" />

Preview

在这里插入图片描述

notice

Id是必须得. 它可以是任何不重复的字符;
如果showFields为空,box里面啥也没有- - ;
vue-tree-down 已发布

npm:vue-tree-down

Logo

前往低代码交流专区

更多推荐