| 12345678910111213141516171819202122232425262728293031323334 |
- const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
- export const layouts = [
- {
- value: 'default',
- label: '默认布局',
- url: '/header-aside/layout'
- },
- {
- value: 'custom',
- label: '自定义布局',
- url: '/custom-layout/layout'
- }
- ]
- const layoutComponent = []
- layouts.forEach(item => {
- layoutComponent[item.value] = _import(item.url, 'layout')
- })
- /**
- * 获取默认布局
- */
- export function getDefaultLayout() {
- return layoutComponent['default']
- }
- /**
- * 获取指定布局
- * @param {*} layoutKey
- */
- export function getLayout(layoutKey) {
- if (!layoutKey || layoutKey === '') return getDefaultLayout()
- return layoutComponent[layoutKey]
- }
|