diff --git a/packages/web3/src/connect-button/index.md b/packages/web3/src/connect-button/index.md index 2ad83d9f7..e86975c5d 100644 --- a/packages/web3/src/connect-button/index.md +++ b/packages/web3/src/connect-button/index.md @@ -37,7 +37,7 @@ A Button for connect chain quickly. | address | Address | `string` | - | - | | name | Name, like ENS | `string` | - | - | | tooltip | Show tooltip when mouse enter address | `boolean \|` [ConnectButtonTooltipProps](#connectbuttontooltipprops) | `true`, will display address by default | - | -| menuItems | Show menu | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - | +| menuItems | Menu items array, menu item can trigger built-in action by binding specific `key`, supported built-in action key: [BuildInMenuItemKey](#buildinmenuitemkey) | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - | | clickActionType | Action when click button, related to `connected` when set to `showProfileModal` | `showProfileModal \| showMenu` | `showProfileModal` | - | ### ConnectButtonTooltipProps @@ -49,3 +49,12 @@ export type ConnectButtonTooltipProps = TooltipProps & { title?: boolean | string | React.ReactNode; // Show content }; ``` + +### BuildInMenuItemKey + +```ts +export enum BuildInMenuItemKey { + CopyAddress = 'copyAddress', // Copy address + Disconnect = 'disconnect', // Disconnect +} +``` diff --git a/packages/web3/src/connect-button/index.zh-CN.md b/packages/web3/src/connect-button/index.zh-CN.md index c6d6bdfdf..6ac2d6f90 100644 --- a/packages/web3/src/connect-button/index.zh-CN.md +++ b/packages/web3/src/connect-button/index.zh-CN.md @@ -35,7 +35,7 @@ group: 组件 | address | 地址 | `string` | - | - | | name | 名称,比如以太坊的 ENS | `string` | - | - | | tooltip | 鼠标移入地址时展示提示 | `boolean \|` [ConnectButtonTooltipProps](#connectbuttontooltipprops) | `true`,默认显示 address 信息 | - | -| menuItems | 展示菜单 | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - | +| menuItems | 菜单项数组,菜单项可通过绑定特定的 `key` 触发内置行为,支持的内置行为 key : [BuildInMenuItemKey](#buildinmenuitemkey) | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - | | clickActionType | 点击按钮时的行为,当设置为 `showProfileModal` 时还与 `connected` 属性相关 | `showProfileModal \| showMenu` | `showProfileModal` | - | ### ConnectButtonTooltipProps @@ -47,3 +47,12 @@ export type ConnectButtonTooltipProps = TooltipProps & { title?: boolean | string | React.ReactNode; // 展示内容 }; ``` + +### BuildInMenuItemKey + +```ts +export enum BuildInMenuItemKey { + CopyAddress = 'copyAddress', // 复制地址 + Disconnect = 'disconnect', // 断开连接 +} +```