目前实测版本2.3.0、2.4.0、3.0.0、3.2.0
详细操作步骤如下:
新建vue文件
这里以
src/views/index2/index2.vue
为例
修改文件
src/config/router.config.js
文件最底部! 382行
{
path: '/index2/index2',
name: 'index2',
component: () => import('@/views/index2/index2')
},
src/permission.js
12行
const whiteList = ['/user/login', '/user/register', '/user/register-result','/user/alteration','/index2/index2']
踩坑:修改后匿名访问该路径页面白屏
原因:加错路由了或者路由路径有误。
办法:在router.config.js
中,确定你的路由写在了constantRouterMap
下。
/**
* 基础路由
* @type { *[] }
*/
export const constantRouterMap = [