vue路由跳转并携带参数

一、由订单号跳转到订单详情页面

 <router-link :to="{path:'/路由地址',query:{传到详情页的参数}}"
 
<el-table-column label="订单编号" align="center" prop="orderNumber"  width="230px">
        <template slot-scope="scope" :show-overflow-tooltip="true">
          <router-link :to="{path:'/trans/detail',query:{orderNumber:scope.row.orderNumber}}" class="link-type">
            <span>{{ scope.row.orderNumber }}</span>
          </router-link>
        </template>
      </el-table-column>

二、订单详情页面接收父页面传输过来的参数

1、返回订单页按钮

<el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-back"
          size="mini"
          @click="handleClose"
        >返回上一页</el-button>
      </el-col>
    </el-row>
    
     /** 返回按钮操作 */
methods: {
 handleClose() {
      const obj = { path: "/trans/order" };
      this.$tab.closeOpenPage(obj);
    }
}
   

2、接收父页面传输的订单号

created() {
    //获取父页面传送过来的订单号   此this.$route.query.orderNumber为父页面<router-link>标签中query中的orderNumber
    const orderNum = this.$route.query.orderNumber;
    this.orderId = orderNum;
    //获取订单详情方法
    this.getOrderDetail(orderNum);
  },

此文章转载自在此仅做自己参考记录使用:Vue带参数页面跳转_vue带参数跳转到详情页面_德鲁大叔撸代码的博客-CSDN博客

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值