一、按钮
<el-button
size="mini"
type="text"
icon="el-icon-time"
@click="handleHistData(scope.row)"
v-hasPermi="['fore:forePara:remove']"
>历史数据</el-button>
/** 历史数据查看 */
handleHistData(row) {
const id = row.id ;
this.$alert("id = " + id)
// 跳转页面
this.$router.push("/fore/strategy/strategyHist/" + id);
},
二、router配置
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [
//在此处添加需要跳转得页面信息
{
path: '/fore',
component: Layout,
hidden: true,
permissions: ['system:strategyHist:list'],
children: [
{
path: 'strategy/strategyHist/:id(\\d+)',
component: () => import('@/views/fore/strategy/strategyHist'),
name: 'histData',
meta: { title: '策略历史', activeMenu: '/fore/strategy/strategyHist' }
}
]
}
]
三、页面接收参数
created() {
const id = this.$route.params && this.$route.params.id;
this.$alert("id = " + id)
},