博客
关于我
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慢查询日志,查询截取分析
查看>>
MySQL慢查询问题排查
查看>>
mysql截取sql语句
查看>>
mysql截取身份证号前几位_EXCEL中怎样截取身份证号前六位数字
查看>>
mysql手工注入
查看>>
MySQL执行SQL文件出现【Unknown collation ‘utf8mb4_0900_ai_ci‘】的解决方案
查看>>
Mysql执行update by id的过程
查看>>
mysql执行计划
查看>>
MySQL执行计划 EXPLAIN参数
查看>>
MySQL执行计划【explain】,看这一篇就够啦!
查看>>
Mysql执行计划字段解释
查看>>
mysql执行计划怎么看
查看>>
MySQL执行计划解读
查看>>
mysql执行顺序与索引算法
查看>>
mysql批量update优化_Mysql中,21个写SQL的好习惯,你值得拥有呀
查看>>
mysql批量update操作时出现锁表
查看>>