博客
关于我
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中null和空字符串的区别与问题!
查看>>
MySQL中ON DUPLICATE KEY UPDATE的介绍与使用、批量更新、存在即更新不存在则插入
查看>>
MYSQL中TINYINT的取值范围
查看>>
MySQL中UPDATE语句的神奇技巧,让你操作数据库如虎添翼!
查看>>
Mysql中varchar类型数字排序不对踩坑记录
查看>>
MySQL中一条SQL语句到底是如何执行的呢?
查看>>
MySQL中你必须知道的10件事,1.5万字!
查看>>
MySQL中使用IN()查询到底走不走索引?
查看>>
Mysql中使用存储过程插入decimal和时间数据递增的模拟数据
查看>>
MySql中关于geometry类型的数据_空的时候如何插入处理_需用null_空字符串插入会报错_Cannot get geometry object from dat---MySql工作笔记003
查看>>