我想点击按钮之后将参数传递到我的子页面,但是发现没有传递过去,求各位大神指点!<li v-for="index in indexs" v-bind:class="{ 'active': cur == index}" class="col-md-1 "> <router-link v-on:click.native="btnClick(index)" v-bind:to="'/schedule/details'+index">{{index}}</router-link> </li>这是我想实现传递参数的地方btnClick: function(data) { if(data != this.cur) { this.cur = data; } }这里是btnClick方法indexs: function() { var left = 1; var right = this.all; var ar = []; if(this.all >= 5) { if(this.cur > 3 && this.cur < this.all - 2) { left = this.cur - 2 right = this.cur + 2 } else { if(this.cur <= 3) { left = 1 right = 5 } else { right = this.all left = this.all - 4 } } } while(left <= right) { ar.push(left) left++ } return ar }这是我的indexs代码因为index是我自己定义的形参,所以不知道该如何传递过去
添加回答
举报
0/150
提交
取消