问题描述:
由于home里面有两个tabControl当点击一个type,在滚动上去的时候带有固定定位的tabcontrol显示出来但是type却没有切换。解决方案:
这个时候需要把两个tabcontrol的currentIndex保持一致。
在tabcontrol的监听点击时间里面。
tabClick(index) {
switch(index) {
case 0 :
this.currentType = 'pop'
break
case 1:
this.currentType = 'new'
break
case 2:
this.currentType = 'sell'
}
//让两个tabControl的currentIndex保持一致
this.$refs.tabControl.currentIndex = index
this.$refs.tabControl1.currentIndex = index
}