feat: 迁移嵌套页面演示

This commit is contained in:
FairyEver 2020-08-31 22:13:41 +08:00
parent e8f9fc53a3
commit 9485aabf31
10 changed files with 15 additions and 60 deletions

View File

@ -14,8 +14,6 @@ import demoBusiness from './modules/demo-business'
import demoD2Crud from './modules/demo-d2-crud' import demoD2Crud from './modules/demo-d2-crud'
// CRUD PLUS // CRUD PLUS
import demoD2CrudPlus from './modules/demo-d2-crud-plus' import demoD2CrudPlus from './modules/demo-d2-crud-plus'
// 第三方网页
import demoFrame from './modules/demo-frame'
/** /**
* @description 给菜单数据补充上 path 字段 * @description 给菜单数据补充上 path 字段
@ -40,8 +38,7 @@ export const menuAside = supplementPath([
demoPlayground, demoPlayground,
demoBusiness, demoBusiness,
demoD2Crud, demoD2Crud,
demoD2CrudPlus, demoD2CrudPlus
demoFrame
]) ])
// 菜单 顶栏 // 菜单 顶栏
@ -60,7 +57,6 @@ export const menuHeader = supplementPath([
demoComponents, demoComponents,
demoCharts, demoCharts,
demoPlugins, demoPlugins,
demoFrame,
{ {
title: '新窗口打开链接', title: '新窗口打开链接',
icon: 'link', icon: 'link',

View File

@ -1,11 +0,0 @@
export default {
path: '/demo/frame',
title: '内嵌网页',
icon: 'globe',
children: (pre => [
{ path: `${pre}index`, title: 'Frame ', icon: 'home' },
{ path: `${pre}d2-doc`, title: 'D2Admin 中文文档', iconSvg: 'd2-admin' },
{ path: `${pre}html`, title: '静态 HTML', icon: 'code' },
{ path: `${pre}report`, title: '构建分析', icon: 'pie-chart' }
])('/demo/frame/')
}

View File

@ -37,6 +37,16 @@ export default {
{ title: '正在开发 3' } { title: '正在开发 3' }
] ]
}, },
{
path: `${pre}frame`,
title: '内嵌网页',
icon: 'globe',
children: [
{ path: `${pre}frame/d2-doc`, title: 'D2Admin 中文文档', iconSvg: 'd2-admin' },
{ path: `${pre}frame/html`, title: '静态 HTML', icon: 'code' },
{ path: `${pre}frame/report`, title: '构建分析', icon: 'pie-chart' }
]
},
{ {
path: `${pre}store`, path: `${pre}store`,
title: '全局状态管理', title: '全局状态管理',

View File

@ -1,20 +0,0 @@
import layoutHeaderAside from '@/layout/header-aside'
// 由于懒加载页面太多的话会造成webpack热更新太慢所以开发环境不使用懒加载只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
const meta = { auth: true }
export default {
path: '/demo/frame',
name: 'demo-frame',
meta,
redirect: { name: 'demo-frame-index' },
component: layoutHeaderAside,
children: (pre => [
{ path: 'index', name: `${pre}index`, component: _import('demo/frame/index'), meta: { ...meta, title: 'Frame 首页' } },
{ path: 'html', name: `${pre}html`, component: _import('demo/frame/html'), meta: { ...meta, title: '静态 HTML' } },
{ path: 'report', name: `${pre}report`, component: _import('demo/frame/report'), meta: { ...meta, title: 'Size report' } },
{ path: 'd2-doc', name: `${pre}d2-doc`, component: _import('demo/frame/d2-doc'), meta: { ...meta, title: 'D2Admin 中文文档' } }
])('demo-frame-')
}

View File

@ -39,6 +39,9 @@ export default {
{ path: 'log/log', name: `${pre}log-log`, component: _import('demo/playground/log/log'), meta: { ...meta, title: '日志记录' } }, { path: 'log/log', name: `${pre}log-log`, component: _import('demo/playground/log/log'), meta: { ...meta, title: '日志记录' } },
{ path: 'add-routes/routes', name: `${pre}add-routes-routes`, component: _import('demo/playground/add-routes/routes'), meta: { ...meta, title: '添加页面' } }, { path: 'add-routes/routes', name: `${pre}add-routes-routes`, component: _import('demo/playground/add-routes/routes'), meta: { ...meta, title: '添加页面' } },
{ path: 'env', name: `${pre}env`, component: _import('demo/playground/env'), meta: { ...meta, title: '环境信息' } }, { path: 'env', name: `${pre}env`, component: _import('demo/playground/env'), meta: { ...meta, title: '环境信息' } },
{ path: 'locales', name: `${pre}locales`, component: _import('demo/playground/locales'), meta: { ...meta, title: '国际化' } } { path: 'locales', name: `${pre}locales`, component: _import('demo/playground/locales'), meta: { ...meta, title: '国际化' } },
{ path: 'frame/html', name: `${pre}frame-html`, component: _import('demo/playground/frame/html'), meta: { ...meta, title: '静态 HTML' } },
{ path: 'frame/report', name: `${pre}frame-report`, component: _import('demo/playground/frame/report'), meta: { ...meta, title: 'Size report' } },
{ path: 'frame/d2-doc', name: `${pre}frame-d2-doc`, component: _import('demo/playground/frame/d2-doc'), meta: { ...meta, title: 'D2Admin 中文文档' } }
])('demo-playground-') ])('demo-playground-')
} }

View File

@ -1,5 +1,4 @@
import playground from './modules/playground' import playground from './modules/playground'
import frame from './modules/frame'
import d2Crud from './modules/d2-crud' import d2Crud from './modules/d2-crud'
import d2CrudPlus from './modules/d2-crud-plus' import d2CrudPlus from './modules/d2-crud-plus'
import plugins from './modules/plugins' import plugins from './modules/plugins'
@ -58,7 +57,6 @@ const frameIn = [
] ]
}, },
playground, playground,
frame,
d2Crud, d2Crud,
d2CrudPlus, d2CrudPlus,
plugins, plugins,

View File

@ -1,21 +0,0 @@
<template>
<d2-container type="ghost">
<d2-module-index-banner slot="header" v-bind="banner"/>
<d2-module-index-menu :menu="menu"/>
</d2-container>
</template>
<script>
import menu from '@/menu/modules/demo-frame'
export default {
data () {
return {
menu,
banner: {
title: 'FRAME',
subTitle: '在 D2Admin 中嵌入其它页面'
}
}
}
}
</script>