<viewclass="tablist"><blockv-for="(item,index) in tabList":key="index"><viewclass="tabItem":class="current == item.id?'active':''"@click="changeTab(item)">{{item.name}}</view></block></view>
const tabList =ref([{id:1,name:'收入'},{id:2,name:'支出'}])const current =ref(1)functionchangeTab(item){current.value = item.id
}