12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import React from 'react';
- import { Button, Row, Col, Card, List, Popconfirm, Tree, Space, Modal } from 'antd';
- import List from './list';
-
- export default (props) => {
-
- const treeData = [
- {
- title: 'parent 1',
- key: '0-0',
- children: [
- {
- title: 'parent 1-0',
- key: '0-0-0',
- disabled: true,
- children: [
- {
- title: 'leaf',
- key: '0-0-0-0',
- disableCheckbox: true,
- },
- {
- title: 'leaf',
- key: '0-0-0-1',
- },
- ],
- },
- {
- title: 'parent 1-1',
- key: '0-0-1',
- children: [
- {
- title: (
- <span
- style={{
- color: '#1890ff',
- }}
- >
- sss
- </span>
- ),
- key: '0-0-1-0',
- },
- ],
- },
- ],
- },
- ];
-
- const onSelect = (selectedKeys, info) => {
- console.log('selected', selectedKeys, info);
- };
- const onCheck = (checkedKeys, info) => {
- console.log('onCheck', checkedKeys, info);
- };
-
- return (
- <div>
- <Row gutter={24}>
- <Col span={8}>
- </Col>
- <Col span={16}>
- <Card title='授权菜单' extra={<Button type='primary' ghost>保存</Button>}>
- <Tree
- checkable
- defaultExpandedKeys={['0-0-0', '0-0-1']}
- defaultSelectedKeys={['0-0-0', '0-0-1']}
- defaultCheckedKeys={['0-0-0', '0-0-1']}
- onSelect={onSelect}
- onCheck={onCheck}
- treeData={treeData}
- />
- </Card>
- </Col>
- </Row>
-
- </div>
- )
- }
|