博客
关于我
Ant Design中Tree组件使用
阅读量:335 次
发布时间:2019-03-04

本文共 2396 字,大约阅读时间需要 7 分钟。

import React, { Component } from 'react'import { Tree } from 'antd'const { DirectoryTree } = Tree;export default class tree extends Component {    state = {    }    /**     * 树     */    getTreeData = () => {        return [            {                title: '机构一',                key: '0-0',                children: [                    {                        title: '用户一',                        key: '0-0-0',                        isLeaf: true,                    },                    {                        title: '用户二',                        key: '0-0-1',                        isLeaf: true,                    },                    {                        title: '用户三',                        key: '0-0-2',                        isLeaf: true,                    },                    {                        title: '用户四',                        key: '0-0-3',                        isLeaf: true,                    },                    {                        title: '用户五',                        key: '0-0-4',                        isLeaf: true,                    },                    {                        title: '用户六',                        key: '0-0-5',                        isLeaf: true,                    },                ],            },            {                title: '机构二',                key: '0-1',                children: [                    {                        title: '用户七',                        key: '0-1-0',                        isLeaf: true,                    },                    {                        title: '用户八',                        key: '0-1-1',                        isLeaf: true,                    },                    {                        title: '用户九',                        key: '0-1-2',                        isLeaf: true,                    },                    {                        title: '用户十',                        key: '0-1-3',                        isLeaf: true,                    },                ],            },        ];    }    onSelect = (selectedKeys, info) => {        console.log('selected', selectedKeys, info);    };    onCheck = (checkedKeys, info) => {        console.log('onCheck', checkedKeys, info);    };    componentWillMount() {        this.treeData = this.getTreeData();    }    render() {        return (            
) }}

 

转载地址:http://umvq.baihongyu.com/

你可能感兴趣的文章
MySQL蜜罐反制获取攻击者信息
查看>>
Mysql表创建外键报错
查看>>
mysql表格调取数据库信息_MySQL™ 参考手册(获取有关数据库和表的信息)
查看>>
mysql表检查分析优化
查看>>
WARN: Establishing SSL connection without server‘s identity verification is not recommended.
查看>>
MySQL要点总结二
查看>>
Mysql覆盖索引
查看>>
mysql视图
查看>>
MySQL视图
查看>>
MySQL视图
查看>>
Mysql视图、变量、存储过程、函数
查看>>
Mysql视图、触发器、事务、储存过程、函数
查看>>
MySQL视图与索引详解
查看>>
mysql视图建立MERGE算法和TEMPTABLE算法的区别(效率与表锁定问题)
查看>>
mysql视图,索引和存储过程
查看>>
mysql解压没有data_Windows 64 位 mysql 5.7以上版本包解压中没有data目录和my-default.ini及服务无法启动的快速解决办法(问题小结)...
查看>>
Mysql解压版安装
查看>>
mysql触发器
查看>>
MySQL设置binlog日志的有效期自动回收
查看>>
Mysql设置字符编码及varchar宽度问题
查看>>