1、路由routers
// 直接配,跳转是打开新页面
{
path: '/login',
name: 'login',
meta: {
title: 'Login - 登录',
hideInMenu: true
},
component: () => import('@/view/login/login.vue')
},
// 跳转在tab栏需要配置二级
{
path: '/',
name: '_home',
redirect: '/home',
component: Main,
meta: {
hideInMenu: true,
notCache: true
},
children: [
{
path: '/home',
name: 'home',
meta: {
hideInMenu: true,
title: '首页',
notCache: true,
icon: 'md-home'
},
component: () => import('@/view/single-page/home')
}
]
},
手动跳转页面传递参数
this.$router.push({
name: 'home',
params: { id: '123'}
})
新页面获取参数
this.$route.params.id