1.src/router 下 route.ts 加入前端静态路由
dynamicRoutes: 这里是跳转后带菜单的
{
path: '/pro/proProjectTaskAcceptance/index.vue',
name: '项目验收',
component: () => import('/@/views/pro/proProjectTaskAcceptance/index.vue'),
meta: {
isHide: true,
},
},
staticRoutes:这里跳转后没有菜单,单一页面
{
path: '/eo1',
name: 'staticRoutes.eo1',
component: () => import('/@/views/pro/proProjectTaskAcceptance/index.vue'),
meta: {
isAuth: false,
},
},
2.页面调用
import router from '/@/router';
方式1:
const btnContant = ()=>{
console.log('btnContant')
// <router-link to="/pro/projectcontant/index">合同审核</router-link>
router.push({
path: '/pro/projectcontant/index',
query: {
context: '吴又可吴又可'
}
});
}
方式2:
const btnAcceptance = ()=>{
console.log('btnAcceptance')
// <router-link to="/pro/proProjectTaskAcceptance/index">项目验收审核</router-link>
router.push({
name: '项目验收',
params: {
context: '吴又可吴又可',
id: 2,
name: '我呢'
}
});
console.log(router)
}
3.页面取值
import router from '/@/router';
onMounted(()=>{
// console.log(router.currentRoute.value.query.context )
console.log(router )
})
标签:index,console,log,pro,link,跳转,pigx,router
From: https://www.cnblogs.com/linhan8888/p/18103889