vue传参跳转

<template>
  <div class="app-container">
    <span>考核时间:{{rulesDetailList.createTime}}</span>
    <span>考核成绩:{{rulesDetailList.eventScore}}</span>
    <span>考核人员:{{rulesDetailList.eventUserName}}</span>
 <span>考核人员-1 需要使用v-for:{{createTime}}</span>
 <span>考核人员-2 需要使用v-for:{{score}}</span>


  </div>
</template>
<script>
import { selectDetailRules } from "@/api/rules/rules";

export default {
  data() {
    return {
      // 考核事件详情表格数据
      rulesDetailList:{},
      params:'',
      createTime:[],
      score:[]
    };
  },
  created() {
    this.getParams();
    this.getList();
  },
  methods: {
    // 获取参数 id
    getParams(){
        this.params = this.$route.query.id
    },
    /** 查询事件规则名称列表 */
    getList() {
        this.loading = true;
        selectDetailRules(this.params).then(response => {   
        this.rulesDetailList = response.data;
        console.log(this.rulesDetailList.eventRuleTypes.length)
         for (let i = 0; i < this.rulesDetailList.eventRuleTypes.length; i++) {
            this.createTime.push(this.rulesDetailList.eventRuleTypes[i].createTime);
            this.score.push(this.rulesDetailList.eventRuleTypes[i].score)
          }
        this.loading = false;
      });
    }
  }
};
</script>

<template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleDetail(scope.row)"
          >详情</el-button>



   /** 查看详情按钮操作 */
    handleDetail(row) {
      //页面跳转 将参数id 传递过去
       this.$router.push({
         path:'/indexTest',
         query: {id: row.id }
       })
    },
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值