adstract router

This commit is contained in:
jiaming 2018-12-14 11:18:45 +08:00
parent 7d7556e075
commit 53f2199087
2 changed files with 40 additions and 35 deletions

37
src/router/demo.js Normal file
View File

@ -0,0 +1,37 @@
const Document = r => require.ensure([], () => r(require('../views/demo/document.vue')), 'demo')
const BorderBox = r => require.ensure([], () => r(require('../views/demo/borderBox.vue')), 'demo')
const Decoration = r => require.ensure([], () => r(require('../views/demo/decoration.vue')), 'demo')
const Chart = r => require.ensure([], () => r(require('../views/demo/chart.vue')), 'demo')
const Table = r => require.ensure([], () => r(require('../views/demo/table.vue')), 'datav')
export default [
{
path: 'document',
name: 'document',
component: Document
},
{
path: 'borderBox',
name: 'borderBox',
component: BorderBox
},
{
path: 'decoration',
name: 'decoration',
component: Decoration
},
{
path: 'chart',
name: 'chart',
component: Chart
},
{
path: 'table',
name: 'table',
component: Table
}
]

View File

@ -2,18 +2,10 @@ import Vue from 'vue'
import Router from 'vue-router'
import demoChildren from './demo'
const Demo = r => require.ensure([], () => r(require('../views/demo/index.vue')), 'demo')
const Document = r => require.ensure([], () => r(require('../views/demo/document.vue')), 'demo')
const BorderBox = r => require.ensure([], () => r(require('../views/demo/borderBox.vue')), 'demo')
const Decoration = r => require.ensure([], () => r(require('../views/demo/decoration.vue')), 'demo')
const Chart = r => require.ensure([], () => r(require('../views/demo/chart.vue')), 'demo')
const Table = r => require.ensure([], () => r(require('../views/demo/table.vue')), 'datav')
const Datav = r => require.ensure([], () => r(require('../views/datavEntrance/index.vue')), 'datav')
const View = r => require.ensure([], () => r(require('../views/dataView/index.vue')), 'datav')
@ -27,31 +19,7 @@ export default new Router({
name: 'demo',
component: Demo,
children: [
{
path: 'document',
name: 'document',
component: Document
},
{
path: 'borderBox',
name: 'borderBox',
component: BorderBox
},
{
path: 'decoration',
name: 'decoration',
component: Decoration
},
{
path: 'chart',
name: 'chart',
component: Chart
},
{
path: 'table',
name: 'table',
component: Table
}
...demoChildren
]
},
{