From eddebd11bf3ead000cfe059e54a4acb19ed81fdc Mon Sep 17 00:00:00 2001 From: keysking Date: Tue, 31 Dec 2019 22:03:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0'=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E4=B8=8A=E6=89=8B'=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/zh/doc/d2-admin/learn/start.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/site/zh/doc/d2-admin/learn/start.md b/site/zh/doc/d2-admin/learn/start.md index 95bab38..e1b3bf2 100644 --- a/site/zh/doc/d2-admin/learn/start.md +++ b/site/zh/doc/d2-admin/learn/start.md @@ -129,9 +129,9 @@ npm run serve ## 新建页面 -`src/pages` 目录是页面存放目录,在此目录下新建目录,例如 **page-demo**: +`src/views` 目录是页面存放目录,在此目录下新建目录,例如 **page-demo**: -![](https://qiniucdn.fairyever.com/20180729095509.png?imageMogr2/auto-orient/thumbnail/1480x/blur/1x0/quality/100|imageslim) +![](http://tuchuang.keysking.com/20191231215232.png) 然后在文件夹内新建 **index.vue** 文件: @@ -147,19 +147,19 @@ npm run serve 上面的代码生成了一个带有 header 和 footer 的页面,页面内容只有一句话,如果您好奇为什么这么写,可以参考 [页面容器](../sys-components/container.md) -![](https://qiniucdn.fairyever.com/20180729095919.png?imageMogr2/auto-orient/thumbnail/1480x/blur/1x0/quality/100|imageslim) +![](http://tuchuang.keysking.com/20191231215700.png) ## 设置路由 `src/router/routes.js` 是路由配置文件。 -在 `frameIn` 变量最后添加: +在 `frameIn` 变量的 `children` 数组最后添加: ``` js { path: '/page-demo', name: 'page-demo', - component: () => import('@/pages/page-demo'), + component: _import('page-demo'), meta: { auth: true, title: '新建示例' @@ -195,9 +195,9 @@ const frameIn = [ { path: '/page-demo', name: 'page-demo', - component: () => import('@/pages/page-demo'), + component: _import('page-demo'), meta: { - auth: true, + auth: true, title: '新建示例' } } From 181d9e17fdaa81b06eb1c4abd9c1fb4f9472554d Mon Sep 17 00:00:00 2001 From: keysking Date: Tue, 31 Dec 2019 22:16:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4'=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E4=B8=8A=E6=89=8B'=E9=A1=B5=E9=9D=A2=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/zh/doc/d2-admin/learn/start.md | 32 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/site/zh/doc/d2-admin/learn/start.md b/site/zh/doc/d2-admin/learn/start.md index e1b3bf2..a15cdbe 100644 --- a/site/zh/doc/d2-admin/learn/start.md +++ b/site/zh/doc/d2-admin/learn/start.md @@ -169,29 +169,43 @@ npm run serve 最后 `frameIn` 变量应该是这样: -``` js {23-31} +``` js {37-45} const frameIn = [ { path: '/', redirect: { name: 'index' }, component: layoutHeaderAside, children: [ + // 首页 { path: 'index', name: 'index', - meta, - component: () => import('@/pages/index') + meta: { + auth: true + }, + component: _import('system/index') }, - // ... + // ...... { - path: '/page3', + path: 'page3', name: 'page3', - component: () => import('@/pages/page3'), meta: { - auth: true, - title: '页面 3' - } + title: '页面 3', + auth: true + }, + component: _import('demo/page3') + }, + // 系统 前端日志 + { + path: 'log', + name: 'log', + meta: { + title: '前端日志', + auth: true + }, + component: _import('system/log') }, + // ...... { path: '/page-demo', name: 'page-demo',