跳转正文

YForbiddenState ​

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

定位 / Owner ​

YForbiddenState 表达权限拒绝,使用 warning state grammar 与可访问 alert/name,不拥有授权判断。

什么时候使用 ​

用于应用根、列表或受保护工作区确认当前用户不可访问时。

不什么时候使用 ​

不要用它替代路由守卫;未登录与加载失败也不是 forbidden。

Public API ​

props:title、description;slot:actions。

Composition ​

权限 owner 决定 forbidden;宿主可提供安全的返回或刷新上下文动作。

Anti-pattern ​

不要在组件内猜测 permission name,也不要向用户泄漏不可见资源详情。

Production Example ​

AppRoot、LegacyYDataTable 与 Data Workbench renderer 正式消费它。

Live Workbench ​

/frontend-module-demo/component-workbench/forbidden-state

Verification / Source ​

  • packages/yoyo-admin/admin-kit/src/ui/components/forbidden-state/YForbiddenState.vue
  • AppRoot consumer 与 accessibility tests

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