前言
由于火狐浏览器某些版本不支持 :to写法,测试后把同事的代码优化一下文章来源地址https://www.toymoban.com/news/detail-689914.html
代码
第一个页面
<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)">
打卡记录
<!--<router-link :to="'/hcp/windowWorker/index/' + scope.row.winId + '/' + queryParams.createTime" class="link-type" size="mini" type="text" style="color: #1890ff">打卡记录</router-link>-->
</el-button>
</template>
</el-table-column>
/*打卡记录*/
toWinWorker(row, createTime) {
const winId = row.winId;
this.$router.push("/hcp/windowWorker/index/" + winId + "/" + createTime);
},
跳转路由js
{
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;
},
文章来源:https://www.toymoban.com/news/detail-689914.html
到了这里,关于若依VUE 从一个页面跳转另一个页面并携带参数的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!