Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@ant-design-vue/pro-layout
Advanced tools
English | 简体中文
npm i @ant-design-vue/pro-layout --save
// or
yarn add @ant-design-vue/pro-layout
import ProLayout from '@ant-design-vue/pro-layout'
// by jsx
export default {
name: 'BasicLayout',
render () {
return (
<ProLayout>
<router-view />
</ProLayout>
)
}
}
<template>
<pro-layout
title="Ant Design Pro"
:menus="menus"
:collapsed="collapsed"
:theme="theme"
:layout="layout"
:contentWidth="contentWidth"
:auto-hide-header="autoHideHeader"
:mediaQuery="query"
:isMobile="isMobile"
:handleMediaQuery="handleMediaQuery"
:handleCollapse="handleCollapse"
:logo="logoRender"
>
<template v-slot:rightContentRender>
<div :class="['ant-pro-global-header-index-right', layout === 'topmenu' && `ant-pro-global-header-index-${theme}`]">
rightContentRender
</div>
</template>
<template v-slot:footerRender>
<div>footerRender</div>
</template>
<setting-drawer navTheme="dark" />
<router-view />
</pro-layout>
</template>
<script>
// by template
import ProLayout, { SettingDrawer } from '@ant-design-vue/pro-layout'
import { asyncRouterMap } from '../config/router.config'
// import svg file
import LogoSvg from '../assets/logo.svg?inline'
export default {
name: 'BasicLayout',
data () {
return {
menus: [],
collapsed: false,
autoHideHeader: false,
query: {},
layout: 'sidemenu',
contentWidth: true,
theme: 'dark',
isMobile: false
}
},
created () {
this.menus = asyncRouterMap.find(item => item.path === '/').children
},
methods: {
handleMediaQuery (query) {
this.query = query
if (this.isMobile && !query['screen-xs']) {
this.isMobile = false
return
}
if (!this.isMobile && query['screen-xs']) {
this.isMobile = true
this.collapsed = false
}
},
handleCollapse (collapsed) {
this.collapsed = collapsed
},
logoRender () {
return <LogoSvg />
}
},
components: {
SettingDrawer
}
}
</script>
Property | Description | Type | Default Value |
---|---|---|---|
title | layout in the upper left corner title | VNode | String | 'Ant Design Pro' |
logo | layout top left logo url | VNode | render | - |
loading* | layout loading status | boolean | - |
layout | layout menu mode, sidemenu: right navigation, topmenu: top navigation | 'sidemenu' | 'topmenu' | 'sidemenu' |
contentWidth | content mode of layout, Fluid: fixed width 1200px, Fixed: adaptive | true | false | false |
theme | Navigation menu theme | 'light' | 'dark' | 'dark' |
menus | Vue-router routes prop | Object | [{}] |
collapsed | control menu's collapse and expansion | boolean | true |
isMobile | is mobile | boolean | false |
handleCollapse | folding collapse event of menu | (collapsed: boolean) => void | - |
menuHeaderRender | render logo and title | VNode | (logo,title)=>VNode | - |
headerRender | custom header render method | (props: BasicLayoutProps) => VNode | - |
rightContentRender | header right content render method | (props: HeaderViewProps) => VNode | - |
collapsedButtonRender | custom collapsed button method | (collapsed: boolean) => VNode | - |
footerRender | custom footer render method | (props: BasicLayoutProps) => VNode | - |
breadcrumbRender | custom breadcrumb render method | ({ route, params, routes, paths, h }) => VNode[] | - |
i18nRender | i18n | Function (key: string) => string | - |
handleMediaQuery | media matchs callback | (querys: []) => void | - |
mediaQuery | media matchs | Array | - |
Property | Description | Type | Default Value |
---|---|---|---|
content | Content area | VNode | v-slot | - |
extra | Extra content area, on the right side of content | VNode | v-slot | - |
extraContent | Extra content area, on the right side of content | VNode | v-slot | - |
tabList | Tabs title list | Array<{key: string, tab: sting}> | - |
tab-change | Switch panel callback | (key) => void | - |
tab-active-key | The currently highlighted tab item | string | - |
Property | Description | Type | Default Value |
---|---|---|---|
theme | Theme | dark light realDark | light |
layout | Sider Layout | sidemenu topmenu | sidemenu |
primaryColor | Primary color (*development only) | #1890ff |
FAQs
Ant Design Pro Layout of Vue, easy to use pro scaffolding.
The npm package @ant-design-vue/pro-layout receives a total of 2,549 weekly downloads. As such, @ant-design-vue/pro-layout popularity was classified as popular.
We found that @ant-design-vue/pro-layout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.