写了一个uniapp tab简单的切换,样式自由发挥
view 部分
<view class="apt-tabs">
<view class="col" v-for="(item,index) in tabs" @click="tab(index)">
<view class="tab-item" :class="index == cur?'active':''">
<text>{{item.name}}</text><text class="dot" v-if="item.isdot"></text>
</view>
</view>
</view>
data 代码部分
cur: 0,
tabs: [{
name: '二维码',
}, {
name: '小程序地址',
},{
name: '授权',
},],
js代码
tab(index) {
this.cur = index
},