123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530 |
- // Just a mock data
- const constantRoutes = [
- {
- path: '/redirect',
- component: 'layout/Layout',
- hidden: true,
- children: [
- {
- path: '/redirect/:path*',
- component: 'views/redirect/index'
- }
- ]
- },
- {
- path: '/login',
- component: 'views/login/index',
- hidden: true
- },
- {
- path: '/auth-redirect',
- component: 'views/login/auth-redirect',
- hidden: true
- },
- {
- path: '/404',
- component: 'views/error-page/404',
- hidden: true
- },
- {
- path: '/401',
- component: 'views/error-page/401',
- hidden: true
- },
- {
- path: '',
- component: 'layout/Layout',
- redirect: 'dashboard',
- children: [
- {
- path: 'dashboard',
- component: 'views/dashboard/index',
- name: 'Dashboard',
- meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
- }
- ]
- },
- {
- path: '/documentation',
- component: 'layout/Layout',
- children: [
- {
- path: 'index',
- component: 'views/documentation/index',
- name: 'Documentation',
- meta: { title: 'Documentation', icon: 'documentation', affix: true }
- }
- ]
- },
- {
- path: '/guide',
- component: 'layout/Layout',
- redirect: '/guide/index',
- children: [
- {
- path: 'index',
- component: 'views/guide/index',
- name: 'Guide',
- meta: { title: 'Guide', icon: 'guide', noCache: true }
- }
- ]
- }
- ]
- const asyncRoutes = [
- {
- path: '/permission',
- component: 'layout/Layout',
- redirect: '/permission/index',
- alwaysShow: true,
- meta: {
- title: 'Permission',
- icon: 'lock',
- roles: ['admin', 'editor']
- },
- children: [
- {
- path: 'page',
- component: 'views/permission/page',
- name: 'PagePermission',
- meta: {
- title: 'Page Permission',
- roles: ['admin']
- }
- },
- {
- path: 'directive',
- component: 'views/permission/directive',
- name: 'DirectivePermission',
- meta: {
- title: 'Directive Permission'
- }
- },
- {
- path: 'role',
- component: 'views/permission/role',
- name: 'RolePermission',
- meta: {
- title: 'Role Permission',
- roles: ['admin']
- }
- }
- ]
- },
- {
- path: '/icon',
- component: 'layout/Layout',
- children: [
- {
- path: 'index',
- component: 'views/icons/index',
- name: 'Icons',
- meta: { title: 'Icons', icon: 'icon', noCache: true }
- }
- ]
- },
- {
- path: '/components',
- component: 'layout/Layout',
- redirect: 'noRedirect',
- name: 'ComponentDemo',
- meta: {
- title: 'Components',
- icon: 'component'
- },
- children: [
- {
- path: 'tinymce',
- component: 'views/components-demo/tinymce',
- name: 'TinymceDemo',
- meta: { title: 'Tinymce' }
- },
- {
- path: 'markdown',
- component: 'views/components-demo/markdown',
- name: 'MarkdownDemo',
- meta: { title: 'Markdown' }
- },
- {
- path: 'json-editor',
- component: 'views/components-demo/json-editor',
- name: 'JsonEditorDemo',
- meta: { title: 'Json Editor' }
- },
- {
- path: 'split-pane',
- component: 'views/components-demo/split-pane',
- name: 'SplitpaneDemo',
- meta: { title: 'SplitPane' }
- },
- {
- path: 'avatar-upload',
- component: 'views/components-demo/avatar-upload',
- name: 'AvatarUploadDemo',
- meta: { title: 'Avatar Upload' }
- },
- {
- path: 'dropzone',
- component: 'views/components-demo/dropzone',
- name: 'DropzoneDemo',
- meta: { title: 'Dropzone' }
- },
- {
- path: 'sticky',
- component: 'views/components-demo/sticky',
- name: 'StickyDemo',
- meta: { title: 'Sticky' }
- },
- {
- path: 'count-to',
- component: 'views/components-demo/count-to',
- name: 'CountToDemo',
- meta: { title: 'Count To' }
- },
- {
- path: 'mixin',
- component: 'views/components-demo/mixin',
- name: 'ComponentMixinDemo',
- meta: { title: 'componentMixin' }
- },
- {
- path: 'back-to-top',
- component: 'views/components-demo/back-to-top',
- name: 'BackToTopDemo',
- meta: { title: 'Back To Top' }
- },
- {
- path: 'drag-dialog',
- component: 'views/components-demo/drag-dialog',
- name: 'DragDialogDemo',
- meta: { title: 'Drag Dialog' }
- },
- {
- path: 'drag-select',
- component: 'views/components-demo/drag-select',
- name: 'DragSelectDemo',
- meta: { title: 'Drag Select' }
- },
- {
- path: 'dnd-list',
- component: 'views/components-demo/dnd-list',
- name: 'DndListDemo',
- meta: { title: 'Dnd List' }
- },
- {
- path: 'drag-kanban',
- component: 'views/components-demo/drag-kanban',
- name: 'DragKanbanDemo',
- meta: { title: 'Drag Kanban' }
- }
- ]
- },
- {
- path: '/charts',
- component: 'layout/Layout',
- redirect: 'noRedirect',
- name: 'Charts',
- meta: {
- title: 'Charts',
- icon: 'chart'
- },
- children: [
- {
- path: 'keyboard',
- component: 'views/charts/keyboard',
- name: 'KeyboardChart',
- meta: { title: 'Keyboard Chart', noCache: true }
- },
- {
- path: 'line',
- component: 'views/charts/line',
- name: 'LineChart',
- meta: { title: 'Line Chart', noCache: true }
- },
- {
- path: 'mixchart',
- component: 'views/charts/mixChart',
- name: 'MixChart',
- meta: { title: 'Mix Chart', noCache: true }
- }
- ]
- },
- {
- path: '/nested',
- component: 'layout/Layout',
- redirect: '/nested/menu1/menu1-1',
- name: 'Nested',
- meta: {
- title: 'Nested',
- icon: 'nested'
- },
- children: [
- {
- path: 'menu1',
- component: 'views/nested/menu1/index',
- name: 'Menu1',
- meta: { title: 'Menu1' },
- redirect: '/nested/menu1/menu1-1',
- children: [
- {
- path: 'menu1-1',
- component: 'views/nested/menu1/menu1-1',
- name: 'Menu1-1',
- meta: { title: 'Menu1-1' }
- },
- {
- path: 'menu1-2',
- component: 'views/nested/menu1/menu1-2',
- name: 'Menu1-2',
- redirect: '/nested/menu1/menu1-2/menu1-2-1',
- meta: { title: 'Menu1-2' },
- children: [
- {
- path: 'menu1-2-1',
- component: 'views/nested/menu1/menu1-2/menu1-2-1',
- name: 'Menu1-2-1',
- meta: { title: 'Menu1-2-1' }
- },
- {
- path: 'menu1-2-2',
- component: 'views/nested/menu1/menu1-2/menu1-2-2',
- name: 'Menu1-2-2',
- meta: { title: 'Menu1-2-2' }
- }
- ]
- },
- {
- path: 'menu1-3',
- component: 'views/nested/menu1/menu1-3',
- name: 'Menu1-3',
- meta: { title: 'Menu1-3' }
- }
- ]
- },
- {
- path: 'menu2',
- name: 'Menu2',
- component: 'views/nested/menu2/index',
- meta: { title: 'Menu2' }
- }
- ]
- },
- {
- path: '/example',
- component: 'layout/Layout',
- redirect: '/example/list',
- name: 'Example',
- meta: {
- title: 'Example',
- icon: 'example'
- },
- children: [
- {
- path: 'create',
- component: 'views/example/create',
- name: 'CreateArticle',
- meta: { title: 'Create Article', icon: 'edit' }
- },
- {
- path: 'edit/:id(\\d+)',
- component: 'views/example/edit',
- name: 'EditArticle',
- meta: { title: 'Edit Article', noCache: true },
- hidden: true
- },
- {
- path: 'list',
- component: 'views/example/list',
- name: 'ArticleList',
- meta: { title: 'Article List', icon: 'list' }
- }
- ]
- },
- {
- path: '/tab',
- component: 'layout/Layout',
- children: [
- {
- path: 'index',
- component: 'views/tab/index',
- name: 'Tab',
- meta: { title: 'Tab', icon: 'tab' }
- }
- ]
- },
- {
- path: '/error',
- component: 'layout/Layout',
- redirect: 'noRedirect',
- name: 'ErrorPages',
- meta: {
- title: 'Error Pages',
- icon: '404'
- },
- children: [
- {
- path: '401',
- component: 'views/error-page/401',
- name: 'Page401',
- meta: { title: 'Page 401', noCache: true }
- },
- {
- path: '404',
- component: 'views/error-page/404',
- name: 'Page404',
- meta: { title: 'Page 404', noCache: true }
- }
- ]
- },
- {
- path: '/error-log',
- component: 'layout/Layout',
- redirect: 'noRedirect',
- children: [
- {
- path: 'log',
- component: 'views/error-log/index',
- name: 'ErrorLog',
- meta: { title: 'Error Log', icon: 'bug' }
- }
- ]
- },
- {
- path: '/excel',
- component: 'layout/Layout',
- redirect: '/excel/export-excel',
- name: 'Excel',
- meta: {
- title: 'Excel',
- icon: 'excel'
- },
- children: [
- {
- path: 'export-excel',
- component: 'views/excel/export-excel',
- name: 'ExportExcel',
- meta: { title: 'Export Excel' }
- },
- {
- path: 'export-selected-excel',
- component: 'views/excel/select-excel',
- name: 'SelectExcel',
- meta: { title: 'Select Excel' }
- },
- {
- path: 'export-merge-header',
- component: 'views/excel/merge-header',
- name: 'MergeHeader',
- meta: { title: 'Merge Header' }
- },
- {
- path: 'upload-excel',
- component: 'views/excel/upload-excel',
- name: 'UploadExcel',
- meta: { title: 'Upload Excel' }
- }
- ]
- },
- {
- path: '/zip',
- component: 'layout/Layout',
- redirect: '/zip/download',
- alwaysShow: true,
- meta: { title: 'Zip', icon: 'zip' },
- children: [
- {
- path: 'download',
- component: 'views/zip/index',
- name: 'ExportZip',
- meta: { title: 'Export Zip' }
- }
- ]
- },
- {
- path: '/pdf',
- component: 'layout/Layout',
- redirect: '/pdf/index',
- children: [
- {
- path: 'index',
- component: 'views/pdf/index',
- name: 'PDF',
- meta: { title: 'PDF', icon: 'pdf' }
- }
- ]
- },
- {
- path: '/pdf/download',
- component: 'views/pdf/download',
- hidden: true
- },
- {
- path: '/theme',
- component: 'layout/Layout',
- redirect: 'noRedirect',
- children: [
- {
- path: 'index',
- component: 'views/theme/index',
- name: 'Theme',
- meta: { title: 'Theme', icon: 'theme' }
- }
- ]
- },
- {
- path: '/clipboard',
- component: 'layout/Layout',
- redirect: 'noRedirect',
- children: [
- {
- path: 'index',
- component: 'views/clipboard/index',
- name: 'ClipboardDemo',
- meta: { title: 'Clipboard Demo', icon: 'clipboard' }
- }
- ]
- },
- {
- path: '/i18n',
- component: 'layout/Layout',
- children: [
- {
- path: 'index',
- component: 'views/i18n-demo/index',
- name: 'I18n',
- meta: { title: 'I18n', icon: 'international' }
- }
- ]
- },
- {
- path: 'external-link',
- component: 'layout/Layout',
- children: [
- {
- path: 'https://github.com/PanJiaChen/vue-element-admin',
- meta: { title: 'External Link', icon: 'link' }
- }
- ]
- },
- { path: '*', redirect: '/404', hidden: true }
- ]
- module.exports = {
- constantRoutes,
- asyncRoutes
- }
|