columnAlign.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import React from 'react';
  2. import { Table } from '@douyinfe/semi-ui';
  3. export default function App() {
  4. const columns = [
  5. {
  6. title: '标题',
  7. dataIndex: 'name',
  8. },
  9. {
  10. title: '大小',
  11. dataIndex: 'size',
  12. },
  13. {
  14. title: '所有者',
  15. dataIndex: 'owner',
  16. },
  17. {
  18. title: '更新日期',
  19. dataIndex: 'updateTime',
  20. },
  21. ];
  22. const data = [
  23. {
  24. key: '1',
  25. name: 'Semi Design 设计稿.fig',
  26. nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/figma-icon.png',
  27. size: '2M',
  28. owner: '姜鹏志',
  29. updateTime: '2020-02-02 05:13',
  30. avatarBg: 'grey',
  31. },
  32. {
  33. key: '2',
  34. name: 'Semi Design 分享演示文稿',
  35. nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
  36. size: '2M',
  37. owner: '郝宣',
  38. updateTime: '2020-01-17 05:31',
  39. avatarBg: 'red',
  40. },
  41. {
  42. key: '3',
  43. name: '设计文档',
  44. nameIconSrc: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png',
  45. size: '34KB',
  46. owner: 'Zoey Edwards',
  47. updateTime: '2020-01-26 11:01',
  48. avatarBg: 'light-blue',
  49. },
  50. ];
  51. return <Table columns={columns} dataSource={data} pagination={false} />;
  52. }