博客
关于我
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性能优化必备25条
查看>>
Mysql性能优化(1):SQL的执行过程
查看>>
Mysql性能优化(2):数据库索引
查看>>
Mysql性能优化(3):分析执行计划
查看>>
Mysql性能优化(4):优化的注意事项
查看>>
Mysql性能优化(5):主从同步原理与实现
查看>>
Mysql性能优化(6):读写分离
查看>>
MySQL性能优化(八)--
查看>>
MySQL性能测试及调优中的死锁处理方法
查看>>
mysql性能测试工具选择 mysql软件测试
查看>>
mysql恢复root密码
查看>>
Mysql悲观锁
查看>>
MySQL慢查询-开启慢查询
查看>>
MySQL慢查询分析和性能优化的方法和技巧
查看>>
MySQL慢查询日志总结
查看>>
Mysql慢查询日志,查询截取分析
查看>>
MySQL慢查询问题排查
查看>>
mysql截取sql语句
查看>>