Files
timi-tdesign-pc/docs/components/admin-layout.md
T
2026-10-30 14:28:27 +08:00

31 lines
978 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AdminLayout 管理台布局
侧边菜单、顶部栏与内容区三区合一的后台骨架,支持扁平菜单、`t-menu-group` 分组菜单、菜单折叠,以及可选的移动端抽屉。
## 基础用法
:::preview 基础用法 || 通过 v-model 双向绑定选中项,menuItems 描述扁平侧边菜单
demo-preview=../demos/admin-layout/basic.vue
:::
传入 `menuGroups` 后,布局会按分组渲染 `t-menu-group`,此时优先使用 `menuGroups`,`menuItems` 作为兼容回退。
## 何时使用
需要标准后台管理界面骨架时使用。菜单只负责渲染与选中态,路由跳转交给菜单项的 `href`、`to` 或 `onClick`。
## 插槽
| 名称 | 说明 |
| --- | --- |
| `logo` | 顶部栏左侧的标识区域。 |
| `menu` | 顶部栏右侧的操作区域。 |
| `sidebar` | 自定义侧边栏内容;不提供时使用 `menuItems` 渲染默认菜单。 |
| 默认 | 主体内容区。 |
## API
<api-table name="AdminLayout" />