Vue点击字段携带参数跳转到另一个页面查询

点击页面

            <el-table-column label="产品名称" align="center" prop="name">
            <template slot-scope="scope">
                <el-button
                    size="mini"
                    type="text"
                    @click="handleDetail(scope.row)"
                >{{scope.row.name}}el-button>
            template>
            el-table-column>
handleDetail(row) {
      this.$router.push({ path: "/business/secretcode", query: { "goodsid" : row.id } });
},

跳转页面

    getList() {
      this.loading = true;
      
        if(this.$route.query.goodsid)
        {
            this.queryParams.goodsid = this.$route.query.goodsid;
            this.$route.query.goodsid=null;
        }
      
      listSecretcode(this.queryParams).then(response => {
        this.secretcodeList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },

你可能感兴趣的:(vue.js,前端)