博客
关于我
实际前端项目路由配置
阅读量:203 次
发布时间:2019-02-28

本文共 1617 字,大约阅读时间需要 5 分钟。

一 组件定义

1 创建vue组件

在src/views文件夹下创建以下文件夹和文件

2 form.vue

3 list.vue

二 路由定义

修改 src/router/index.js 文件,重新定义constantRouterMap

注意:每个路由的name不能相同

export const constantRouterMap = [  { path: '/login', component: () => import('@/views/login/index'), hidden: true },  { path: '/404', component: () => import('@/views/404'), hidden: true },  {    path: '/',    component: Layout,    redirect: '/dashboard',    name: 'Dashboard',    hidden: true,    children: [{      path: 'dashboard',      component: () => import('@/views/dashboard/index')    }]  },  // 讲师管理  {    path: '/teacher',    component: Layout,    redirect: '/teacher/list',    name: 'Teacher',    meta: { title: '讲师管理' },    children: [      {        path: 'list',        name: 'TeacherList',        component: () => import('@/views/teacher/list'),        meta: { title: '讲师列表' }      },      {        path: 'create',        name: 'TeacherCreate',        component: () => import('@/views/teacher/form'),        meta: { title: '添加讲师' }      },      {        path: 'edit/:id',        name: 'TeacherEdit',        component: () => import('@/views/teacher/form'),        meta: { title: '编辑讲师' },        hidden: true      }    ]  },  { path: '*', redirect: '/404', hidden: true }]

三 项目其他配置

1 项目名称

将 vue-admin-template-master 重命名为 guli_admin

2 端口号

在 config/index.js中修改

port: 9528,

3 国际化设置

src/main.js,第7行,修改语言为 zh-CN,使用中文语言环境,例如:日期时间组件

import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

4 入口页面

index.html

谷粒学院后台管理系统

5 登录页

src/views/login/index.vue,第4行

谷粒学院后台管理系统

四 测试

转载地址:http://uqqj.baihongyu.com/

你可能感兴趣的文章
mysql中对于数据库的基本操作
查看>>
Mysql中常用函数的使用示例
查看>>
MySql中怎样使用case-when实现判断查询结果返回
查看>>
Mysql中怎样使用update更新某列的数据减去指定值
查看>>
Mysql中怎样设置指定ip远程访问连接
查看>>
mysql中数据表的基本操作很难嘛,由这个实验来带你从头走一遍
查看>>
Mysql中文乱码问题完美解决方案
查看>>
mysql中的 +号 和 CONCAT(str1,str2,...)
查看>>
Mysql中的 IFNULL 函数的详解
查看>>
mysql中的collate关键字是什么意思?
查看>>
MySql中的concat()相关函数
查看>>
mysql中的concat函数,concat_ws函数,concat_group函数之间的区别
查看>>
MySQL中的count函数
查看>>
MySQL中的DB、DBMS、SQL
查看>>
MySQL中的DECIMAL类型:MYSQL_TYPE_DECIMAL与MYSQL_TYPE_NEWDECIMAL详解
查看>>
MySQL中的GROUP_CONCAT()函数详解与实战应用
查看>>
MySQL中的IO问题分析与优化
查看>>
MySQL中的ON DUPLICATE KEY UPDATE详解与应用
查看>>
mysql中的rbs,SharePoint RBS:即使启用了RBS,内容数据库也在不断增长
查看>>
mysql中的undo log、redo log 、binlog大致概要
查看>>