## DageTableActions 表格操作栏

### 基本用法

```tsx
import React from "react";
import { Table, message } from "antd";
import { DageTableActions } from "@dage/pc-components";

interface DataType {
  name: string;
  key: string;
  age: number;
  address: string;
}

export default () => {
  const COLUMNS = [
    {
      title: "姓名",
      dataIndex: "name",
      key: "name",
    },
    {
      title: "年龄",
      dataIndex: "age",
      key: "age",
    },
    {
      title: "住址",
      dataIndex: "address",
      key: "address",
    },
    {
      title: "操作",
      render: (item: DataType) => {
        return <DageTableActions onEdit={handleEdit} onDelete={handleDelete} />;
      },
    },
  ];

  const handleEdit = () => {
    message.info("handleEdit");
  };

  const handleDelete = () => {
    return new Promise((res) => {
      setTimeout(() => {
        message.error("handleDelete");
        res();
      }, 2000);
    });
  };

  return (
    <Table
      dataSource={[
        {
          key: "1",
          name: "胡彦斌",
          age: 32,
          address: "西湖区湖底公园1号",
        },
      ]}
      columns={COLUMNS}
    />
  );
};
```

### 自定义组件

```tsx
import React from "react";
import { Table, Button } from "antd";
import { DageTableActions } from "@dage/pc-components";

interface DataType {
  name: string;
  key: string;
  age: number;
  address: string;
}

export default () => {
  const COLUMNS = [
    {
      title: "姓名",
      dataIndex: "name",
      key: "name",
    },
    {
      title: "年龄",
      dataIndex: "age",
      key: "age",
    },
    {
      title: "住址",
      dataIndex: "address",
      key: "address",
    },
    {
      title: "操作",
      render: (item: DataType) => {
        return (
          <DageTableActions
            renderBefore={
              <Button size="small" type="text">
                查看
              </Button>
            }
          />
        );
      },
    },
  ];

  return (
    <Table
      dataSource={[
        {
          key: "1",
          name: "胡彦斌",
          age: 32,
          address: "西湖区湖底公园1号",
        },
      ]}
      columns={COLUMNS}
    />
  );
};
```

## API

<API hideTitle src='@dage/pc-components/components/TableActions/index.d.ts'></API>
