1.0.0 • Published 3 years ago

vue-tagtree3 v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

vue-tagtree

一、安装

npm install vue-tagtree

**image**

**image**

二、使用方法

1、html
<tagtree 
        title="栏目选择"
        width="300"
        :dataList="columnList"
        :props="defaultProps"
        nodeKey="subjectUuid"
></tagtree>
2、js
import tagtree from 'vue-tagtree'
import 'vue-tagtree/dist/tagtree.css'
export default {
  components: {
    tagtree
  },
  data() {
    return {
      defaultProps: {
        label: "name",
        children: "subjectList",
      },
      columnList: [
        {
          name: "栏目1",
          subjectUuid: "1",
          subjectList: [
            {
              name: "栏目1-1",
              subjectUuid: "1-1",
            },
          ],
        },
        {
          name: "栏目2",
          subjectUuid: "2",
          subjectList: [],
        },
      ]
    };
  }
};

三、API

1、Attributes属性
属性说明类型默认值
title弹窗标题String如“栏目选择”
width框的宽度String“800”
dialogWidth弹窗宽度String“40%”
nodeKey节点idString“Id”
dataList数据,必填Array
defaultChecked默认选中节点,id数组Array"1","2"
defaultExpandAll节点是否全部展开Booleanfalse
dialogModal开启遮罩层Booleantrue
props自定义树节点属性,必填Object{ label: "label",children: "children"}
checkStrictly父子节点是否相互关联Booleantrue
tagClosable标签是否可关闭Booleantrue
dialogLoading弹窗loadingBooleanfalse
disableChildren父节点选中禁用子节点Booleanfalse
disableParent禁用所有父节点Booleanfalse
oneChecked单选Booleanfalse
2、Events事件
事件名说明
@update-data选中后的值
@showDialogTagtree说明点击了tagtree可赋值true
1.0.1

3 years ago

1.0.0

3 years ago