博客
关于我
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定时器Events
查看>>
Mysql定时备份脚本
查看>>
mysql实战01|基础架构:一条SQL查询语句是如何执行的?
查看>>
Mysql实战之数据备份
查看>>
MySQL实战教程:从小白到大神的进阶之路!
查看>>
mysql实现成绩排名
查看>>
Mysql客户端中文乱码问题解决
查看>>
mysql客户端工具使用
查看>>
MySQL密码忘记,怎么办?
查看>>
mysql对同一张表进行查询和赋值更新
查看>>
mysql导入数据库出现:Incorrect string value: '\xE7\x82\xB9\xE9\x92\x9F' for column 'chinese' at row 1...
查看>>
mysql导入(ibd文件)
查看>>
Mysql工作笔记006---Mysql服务器磁盘爆满了_java.sql.SQLException: Error writing file ‘tmp/MYfXO41p‘
查看>>
MySQL工具1:mysqladmin
查看>>
mysql常用命令
查看>>
MySQL常用命令
查看>>
mysql常用命令
查看>>
Warning: mkdir(): No such file or directory in D:\phpstudy_pro\WWW\**** linux mkdir
查看>>
MySQL常用指令集
查看>>