Vue tab切换功能
html部分
<ul class="ul1">
<li @click="qh(0)">总计</li>
<li @click="qh(1)">自营</li>
<li @click="qh(2)">银行渠道</li>
<li @click="qh(3)">互联网渠道</li>
</ul>
<div v-show="temp == 0">
<div id="totle" style="height: 350px"></div>
</div>
<div v-show="temp == 1">
<div id="self-support" style=" height: 350px"></div>
</div>
<div v-show="temp == 2">
<div id="bank" style=" height: 350px"></div>
</div>
<div v-show="temp == 3">
<div id="internet" style=" height: 350px"></div>
</div>
js部分
data() {
return {
temp: 0,
}
},
methods: {
qh: function(t) {
this.temp = t
}
}