由于火狐浏览器某些版本不支持 :to写法,测试后把同事的代码优化一下
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="toWinWorker(scope.row, queryParams.createTime)">
打卡记录
el-button>
template>
el-table-column>
/*打卡记录*/
toWinWorker(row, createTime) {
const winId = row.winId;
this.$router.push("/hcp/windowWorker/index/" + winId + "/" + createTime);
},
{
path: '/hcp',
component: Layout,
hidden: true,
children: [
{
path: 'windowWorker/index/:id/:date',
component: (resolve) => require(['@/views/hcp/windowWorker/index'], resolve),
name: 'WindowWorker',
meta: {title: '工作人员打卡记录', icon: ''}
}
]
},
// 把携带的参数放到queryParams查询参数里
created() {
this.queryParams.winId = this.$route.params && this.$route.params.id;
this.queryParams.createTime = this.$route.params && this.$route.params.date;
},