vue-element-admin模板,点击跳转到另一个页面传参

2022年7月30日10:14:29

a页面

<template><div><el-table:data="tableData"><el-table-column  prop="id"  align="center"   label="ID"/><el-table-column label="操作"><template slot-scope="scope"><el-button type="text" size="mini" @click="showDetail(scope.row)">详情</el-button></template></el-table-column></el-table></div></template><script>exportdefault{data(){return{
            tableData:[{id:1}]}},
      methods:{// 跳转会员详情showDetail(row){this.$router.push({ path:'/b', query:{ Id: row.id}})//带参跳转},}}</script>

b页面

exportdefault{data(){return{
    user_id:''}},created(){this.user_id=this.$route.query.id//接收参数}}
  • 作者:漂移的电子
  • 原文链接:https://blog.csdn.net/weixin_40030173/article/details/101778682
    更新时间:2022年7月30日10:14:29 ,共 537 字。