| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import React, { useMemo } from 'react';
- import { Table, Avatar } from '@douyinfe/semi-ui';
- import { IconMore } from '@douyinfe/semi-icons';
- export default function App() {
- const columns = [
- {
- title: '标题',
- dataIndex: 'name',
- width: 400,
- render: (text, record, index) => {
- return (
- <div>
- <Avatar
- size="small"
- shape="square"
- src={record.nameIconSrc}
- style={{ marginRight: 12 }}
- ></Avatar>
- {text}
- </div>
- );
- },
- },
- {
- title: '大小',
- dataIndex: 'size',
- },
- {
- title: '所有者',
- dataIndex: 'owner',
- render: (text, record, index) => {
- return (
- <div>
- <Avatar size="small" color={record.avatarBg} style={{ marginRight: 4 }}>
- {typeof text === 'string' && text.slice(0, 1)}
- </Avatar>
- {text}
- </div>
- );
- },
- },
- {
- title: '更新日期',
- dataIndex: 'updateTime',
- },
- {
- title: '',
- dataIndex: 'operate',
- render: () => {
- return <IconMore />;
- },
- },
- ];
- const pagination = useMemo(
- () => ({
- pageSize: 3,
- }),
- []
- );
- return <Table columns={columns} dataSource={[]} rowSelection pagination={pagination} />;
- }
|