cnd-components-mcp
Version:
An MCP service for Cnd components query | 一个减少 Cnd 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询
23 lines • 5.27 kB
Markdown
按钮通常用于触发操作行为或任务流程。其中分隔按钮属于复合组件,由 Button 和 Menu 组成,其在触发区域上可以分为两部分,其中 Icon 部分作为弹层菜单的触发区域,菜单只有在鼠标悬浮或点击右侧图标区域的时候才会展示
| 参数 | 说明 | 类型 | 默认值 | 是否必填 |
| --------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------- |
| type | 按钮的类型 | 'primary' | 'secondary' | 'normal' | 'normal' | |
| size | 按钮的尺寸 | ButtonSize | 'medium' | |
| icons | 按钮中可配置的 Icon | { loading?: `React.ReactNode` } | - | |
| iconSize | 按钮中 Icon 的尺寸 | | number<br/> | 'xxs'<br/> | 'xs'<br/> | 'small'<br/> | 'medium'<br/> | 'large'<br/> | 'xl'<br/> | 'xxl'<br/> | 'xxxl'<br/> | 'inherit' | 默认根据 size 自动映射,映射规则:<br/>size:large -> `small`<br/>size:medium -> `xs`<br/>size:small -> `xs` | |
| htmlType | button 标签的 type 值 | 'submit' | 'reset' | 'button' | 'button' | |
| component | 最终渲染的 jsx 标签标签类型 | 'button' | 'a' | `React.ComponentType`\<unknown> | - | |
| loading | 设置按钮的载入状态 | boolean | false | |
| ghost | 是否为幽灵按钮 | true | false | 'light' | 'dark' | false | |
| text | 是否为文本按钮 | boolean | false | |
| warning | 是否为警告按钮 | boolean | false | |
| disabled | 是否禁用 | boolean | false | |
| onClick | 点击按钮的回调 | `React.MouseEventHandler` | - | |
| 参数 | 说明 | 类型 | 默认值 | 是否必填 |
| ---- | ------------------------------ | ---------- | ------ | -------- |
| size | 统一设置 Button 组件的按钮大小 | ButtonSize | - | |
按钮类型
| 按键 | 说明 |
| :---- | :-------------- |
| Enter | 触发onClick事件 |
| SPACE | 触发onClick事件 |