跳转正文

YAlert ​

适用范围:Legacy Admin Kit / Schema 与旧 admin-vue。新 admin-nuxtui 的开发入口见管理端 Nuxt UI 指南。

定位 / Owner ​

YAlert 呈现与当前任务相关的可见消息;warning/error 使用 alert announcement,info/success 使用 status announcement。

什么时候使用 ​

用于字段组上方的错误、权限提示、保存警告或可恢复说明。

不什么时候使用 ​

短暂全局反馈使用 feedback port;整页 error/forbidden 使用对应 State component。

Public API ​

props:tone(info/success/warning/error)、title、description;action slot。

Composition ​

业务 owner 决定何时显示与 action 行为;Alert 只拥有语义和视觉层级。

Anti-pattern ​

不要只用颜色传达严重度,也不要把复杂表单放进 action slot。

Production Example ​

Tenant Editor、Edition Editor、Role Permission 和 AuthTaskSurface 直接消费它。

Live Workbench ​

/frontend-module-demo/component-workbench/alert

Verification / Source ​

  • packages/yoyo-admin/admin-kit/src/ui/components/alert/YAlert.vue
  • component-productization-batch-2.spec.ts 与业务 consumer

YoyoBoot · 从真实项目走向可复用能力