若依(ruoyi)管理系统,自定义按钮跳转页面
原文链接:https://blog.csdn.net/ahwangzc/article/details/122505807
// route.js中新增
// 公共路由
export const constantRoutes = [
{
path: '/businessProcess',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'marineSpecialAddOrUpdate',
component: () => import('@/views/businessProcess/marineSpecial/marineSpecialAddOrUpdate'),
name: 'marineSpecialAddOrUpdate',
meta: { title: '海运专线新增/修改', icon: 'user' }
}
]
}
]
// 组件中新增跳转路由
<router-link to="/businessProcess/marineSpecialAddOrUpdate">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
>新增</el-button>
</router-link>
//亦可点击按钮跳转
function goAddOrUpdate(row) {
router.push({
path: '/businessProcess/marineSpecialAddOrUpdate',
query: {
// id: row.id
}
})
}