bee-table/demo/demolist/Demo1.js

46 lines
979 B
JavaScript
Raw Normal View History

2016-12-26 16:52:39 +08:00
/**
*
2017-01-11 17:01:50 +08:00
* @title 简单表格
* @description
2016-12-26 16:52:39 +08:00
*
*/
2016-12-26 22:04:16 +08:00
2017-08-30 13:31:26 +08:00
2017-09-08 15:07:55 +08:00
import React, { Component } from 'react';
import Table from '../../src';
2017-01-11 17:01:50 +08:00
const columns = [
{ title: '用户名', dataIndex: 'a', key: 'a', width: 100 },
{ id: '123', title: '性别', dataIndex: 'b', key: 'b', width: 100 },
{ title: '年龄', dataIndex: 'c', key: 'c', width: 200 },
{
title: '操作', dataIndex: '', key: 'd', render() {
return <a href="#">一些操作</a>;
},
},
];
2016-12-26 22:04:16 +08:00
2017-01-11 17:01:50 +08:00
const data = [
{ a: '令狐冲', b: '男', c: 41, key: '1' },
{ a: '杨过', b: '男', c: 67, key: '2' },
{ a: '郭靖', b: '男', c: 25, key: '3' },
];
2016-12-26 22:04:16 +08:00
export class Demo1 extends Component {
2017-01-11 17:01:50 +08:00
render () {
return (
<Table
columns={columns}
data={data}
2017-01-12 08:53:51 +08:00
title={currentData => <div>标题: 这是一个标题</div>}
footer={currentData => <div>表尾: 我是小尾巴</div>}
2017-01-11 17:01:50 +08:00
/>
)
}
2016-12-26 16:52:39 +08:00
}
2017-08-30 13:31:26 +08:00
2017-09-08 15:07:55 +08:00
export default Demo1;