UNPKG

cnd-components-mcp

Version:

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

47 lines (40 loc) 1.09 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: <span style={{ fontWeight: 500 }}>标题</span>, content, type, duration: 100000, }); }; const content = ( <div> <p> 提醒内容置于页面右上,边距各8px,内容超长请折行显示。提醒内容置于页面右上,边距各8px,内容超长请折行显示。 </p> <Button type="primary" size="small"> 基础按钮 </Button> </div> ); export default () => { return ( <Button type="primary" onClick={() => openNotificationWithTitle('notice', content)} > 带标题以及行动按钮 </Button> ); }; export const meta = { title: '带标题以及行动按钮', describe: '通过 open 方法唤起提醒, 提醒内容content 支持定制', }; ```