# Component API Reference
## MyTableActions
Renders row-level action buttons with permission filtering and automatic folding into a "更多" dropdown.
```tsx
import { MyTableActions } from '@/common';
,
update: ,
delete: {}} />,
}}
maxVisible={3}
/>
```
### Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `actions` | `Record` | required | Map of permission keys to React nodes. |
| `maxVisible` | `number` | `3` | Maximum buttons shown directly; overflow goes to dropdown. |
| `path` | `string` | `location.pathname` | Optional route path for permission lookup. |
### Behavior
- Calls `useCurrentPermissions` internally.
- Filters `actions` by the current page's submenu permissions.
- If no permissions match, returns `null`.
- If visible count ≤ `maxVisible`, renders in a ``.
- If visible count > `maxVisible`, renders `maxVisible` buttons + a "更多" dropdown with the rest.
---
## MyToolBarActions
Renders toolbar buttons (e.g., export, add) with permission filtering. Intended for `ProTable.toolBarRender`.
```tsx
import { MyToolBarActions } from '@/common';
toolBarRender={(action) => [
,
add: ,
}}
/>,
]}
```
### Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `actions` | `Record` | required | Map of permission keys to React nodes. |
| `path` | `string` | `location.pathname` | Optional route path for permission lookup. |
### Behavior
- Calls `useCurrentPermissions` internally.
- Returns an array of matched nodes (no wrapping element).
- Safe to place directly inside `toolBarRender` arrays.