瀏覽代碼

📝 docs(ui-style): add message prompt specification

- add message提示规范章节,统一消息提示使用方式
- 规定使用App.useApp()获取message实例
- 明确消息提示类型区分:success/error/warning/info
- 说明消息显示时长使用默认值,重要操作可适当延长至3秒
yourname 5 月之前
父節點
當前提交
bb27a89cf6
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15 0
      .roo/rules/13-ui-style.md

+ 15 - 0
.roo/rules/13-ui-style.md

@@ -94,6 +94,21 @@
 - 加载状态使用 `loading` 属性显示加载指示器
 - 删除等危险操作使用 `Popconfirm` 组件二次确认
 
+## 5.4 消息提示规范
+- 统一使用App.useApp()获取message实例
+  ```typescript
+  import { App } from 'antd';
+  const { message } = App.useApp();
+  ```
+- 消息提示使用明确的类型区分:
+  ```typescript
+  message.success('操作成功');
+  message.error('操作失败');
+  message.warning('警告信息');
+  message.info('提示信息');
+  ```
+- 消息显示时长统一使用默认值,重要操作可适当延长:`message.success('操作成功', 3);`
+
 ## 6. 图标规范
 
 ### 6.1 图标选择