链接

image.png

  1. import { Link } from '@umijs/max';
  2. import { Typography } from 'antd';
  3. const { Text } = Typography;
  4. const action = {
  5. title: '操作',
  6. key: 'action',
  7. render: (_, record) => {
  8. const url = record.url;
  9. return [
  10. <Link to='/web/screen' target="_blank" key='link'>
  11. <Text
  12. className='text-blue-500'
  13. copyable={{ text: url }}
  14. >
  15. 查看奖项
  16. </Text>
  17. </Link>
  18. ]
  19. }
  20. }

Typography.Link

  1. import { Typography } from 'antd';
  2. const { Link } = Typography;
  3. const action = {
  4. title: '操作',
  5. key: 'action',
  6. render: (_, record) => {
  7. const url = record.url;
  8. return [
  9. <Link
  10. copyable={{ text: url }}
  11. href='/web/screen'
  12. target="_blank"
  13. key='link'
  14. >
  15. 查看奖项
  16. </Link>
  17. ]
  18. }
  19. }

Divider 链接分组

Divider 用 type=”vertical” 设置为行内的垂直分割线
image.png

  1. import { Divider, Typography } from 'antd';
  2. const { Link } = Typography;
  3. const action = {
  4. title: '操作',
  5. key: 'action',
  6. render: (_, record) => {
  7. const url = record.url;
  8. return [
  9. <Link href="#" key='view'>查看</Link>
  10. <Divider type="vertical" key='1'/>
  11. <Link href="#" key='edit'>编辑</Link>
  12. <Divider type="vertical" key='2' />
  13. <Link href="#" key='view'>预览</Link>
  14. ]
  15. }
  16. }