UNPKG

cnd-components-mcp

Version:

An MCP service for Cnd components query | 一个减少 Cnd 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询

45 lines (40 loc) 1.14 kB
## 示例 ```tsx import React from 'react'; import { Button, Notification } from '@alicloud/console-components'; const openNotificationWithTitle = ( type?: 'success' | 'error' | 'warning' | 'notice' | 'help' | undefined, content: `React.ReactNode` = '提醒内容置于页面右上,边距各8px' ) => { Notification.open({ title: &lt;span style={{ fontWeight: 500 }}&gt;标题&lt;/span&gt;, content, type, duration: 100000, }); }; const content = ( &lt;div&gt; &lt;p&gt; 提醒内容置于页面右上,边距各8px,内容超长请折行显示。提醒内容置于页面右上,边距各8px,内容超长请折行显示。 &lt;/p&gt; &lt;Button type="primary" size="small"&gt; 基础按钮 &lt;/Button&gt; &lt;/div&gt; ); export default () => { return ( <Button type="primary" onClick={() => openNotificationWithTitle('notice', content)} > 带标题以及行动按钮 &lt;/Button&gt; ); }; export const meta = { title: '带标题以及行动按钮', describe: '通过 open 方法唤起提醒, 提醒内容content 支持定制', }; ```