table.jsx 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import React from 'react';
  2. import { Table } from 'antd';
  3. class TableView extends React.Component {
  4. constructor(props) {
  5. super(props);
  6. this.state = {
  7. }
  8. }
  9. render() {
  10. const columns = [{
  11. title: '名称',
  12. key: 'c1',
  13. dataIndex: 'name'
  14. }, {
  15. title: '创建人',
  16. key: 'c2',
  17. dataIndex: 'c2'
  18. }, {
  19. title: '最近修改时间',
  20. key: 'c3',
  21. dataIndex: 'c3'
  22. }, {
  23. title: '操作',
  24. key: 'c4',
  25. dataIndex: 'c4'
  26. }];
  27. const data = [{
  28. key: '1',
  29. c1: 'sssss',
  30. c2: 'aaaaa'
  31. }, {
  32. key: '2',
  33. c1: '啊啊啊啊',
  34. c2: 'aaaadddbb'
  35. }]
  36. return (
  37. <Table columns={columns} dataSource={data}/>
  38. );
  39. }
  40. }
  41. export default TableView;