# antdv-pro-layout
**Repository Path**: alexl2/antdv-pro-layout
## Basic Information
- **Project Name**: antdv-pro-layout
- **Description**: 【Vue3】Ant Design Pro布局Vue,易于使用专业脚手架。
- **Primary Language**: TypeScript
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2025-01-15
- **Last Updated**: 2025-01-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Ant Design Vue Pro Layout
Ant Design Pro Layout of Vue, easy to use pro scaffolding.
[](./package.json)
[](https://www.npmjs.com/package/antdv-pro-layout)
[](https://www.npmjs.com/package/antdv-pro-layout)

[中文](./README.md) | [English](./README.en.md)
## Install
```bash
npm i antdv-pro-layout
```
## Simple Usage
First, you should add the `antdv-pro-layout` that you need into the library.
```js
// main.[js|ts]
import { createApp } from "vue";
import App from "./App.vue";
import "ant-design-vue/dist/reset.css";
import Antd from "ant-design-vue";
import 'antdv-pro-layout/dist/style.css';
import { ProLayout, PageContainer } from "antdv-pro-layout";
const app = createApp(App);
app.use(Antd).use(ProLayout).use(PageContainer).mount("#app");
```
After that, you can use pro-layout in your Vue components as simply as this:
```vue
```
## API
### Function Layout - ProLayout
- `MediaQueryEnum` Screen size media query enumeration object
- `getMediaScreen` Screen size
- `useMediaScreen` Screen size ref responds to listening
- `PrefersColorSchemeEnum` Media theme color mode enumeration object
- `getPrefersColorScheme` Media Theme Color Mode Preferences
- `usePrefersColorScheme` Media Theme Color Mode Preferences ref responds to listening
- `viewTransitionTheme` Theme switching view transitions
- `getMenuData` The routing table exits the system menu
- `clearMenuItem` Clear menu item, property excluded !name and meta
### Component Layout - ProLayout
| Property | Description | Type | Default Value |
| ----------------------- | ---------------------- | -------------------------------- | ------------------ |
| title | Text to the right of the layout LOGO | string | `'Ant Design Pro'` |
| logo | Layout Logo Link | string | - |
| logoStyle | Layout Logo Style | object | - |
| loading | Layout content area loading waiting status | boolean | false |
| layout | Menu Layout | 'side' \| 'top' \| 'mix' | `'side'` |
| breadcrumb | Layout content: Breadcrumbs in the upper left corner | Object | - |
| theme | Global Theme Colors | 'light' \|'dark' | `'light'` |
| menuTheme | Menu navigation theme color | 'light' \|'dark' | `'light'` |
| menuData | Menu item data [`MenuDataItem[]`](dist\types\typings\index.d.ts) | Array | `[]` |
| collapsed | When the left side of the menu is closed and expanded | boolean | `true` |
| collapsedWidth | Collapse width size on the left side of the menu | number | 48 |
| siderWidth | Expand width size on the left side of the menu | number | 200 |
| selectedKeys | Choose highlight keys from the menu | string[] | `[]` |
| openKeys | Menu select open expand keys | string[] | `[]` |
| fixSiderbar | Fixed list on left side of menu | boolean | `false` |
| splitMenus | The menu layout `mix` splits the secondary menu to the left | boolean | `false` |
| menuHeaderRender | Renders the header logo and header area of the menu | v-slot \| VNode \| (props: BasicLayoutProps) => VNode \| false | - |
| menuHeaderExtraRender | Render menu header expands area | v-slot \| VNode \| (props: BasicLayoutProps) => VNode \| false | - |
| menuFooterRender | Render the footer area of the menu | v-slot \| VNode \| (props: BasicLayoutProps) => VNode \| false | - |
| menuItemRender | Render menu items Menu.Item | v-slot#menuItemRender="menuItem" | - |
| menuSubItemRender | Nested subitems of the render menu Menu.SubItem | v-slot#menuSubItemRender="menuItem" | - |
| collapsedButtonRender | The render menu closes the button area | v-slot#collapsedButtonRender="collapsed" | - |
| fixedHeader | The top area is fixed | boolean | `false` |
| headerRender | Render the top area | v-slot \| VNode \| (props: BasicLayoutProps) => VNode | - |
| headerContentRender | Render the top content area, only the `side` layout works | v-slot \| (props: BasicLayoutProps) => VNode | - |
| headerContentRightRender| Renders the right area of the top content | v-slot \| (props: BasicLayoutProps) => VNode | - |
| footerRender | Render the bottom area | v-slot \| ({ width, ...props }) => VNode | `false` |
| tabRender | Renders the top tab area | v-slot \| ({ width, ...props }) => VNode | `false` |
| breadcrumbRender | Render the BREADCRUMB area | v-slot \| ({ route, params, routes, paths, h }) => VNode[] | - |
| locale | Menu name internationalization function processing | Function(menuDataItem?: MenuDataItem) => string \| `false` | `false` |
| collapse | The left side of the menu folds up to expand the trigger function processing | Function(collapsed: boolean) => void | - |
> Menu generation requires `getMenuData` and `clearMenuItem` function transformations
> For example: `const { menuData } = getMenuData(clearMenuItem(routes))`
#### Custom Render
##### headerContentRender
```vue