<van-tabs v-model="active" animated @click="onClick">
<van-tab v-for="(item,index) in dome" :title="item.test" :key="index" ></van-tab>
</van-tabs>
vant里面的tabs事件参数是固定的索引
下面是我想要的
<van-tabs v-model="active" animated >
<van-tab v-for="(item,index) in dome" @click="onClick(item.id)" :title="item.test" :key="index" ></van-tab>
</van-tabs>
dome:[
{ id:1, test:"a", }, { id:2, test:"b", }, { id:3, test:"c", }, { id:4, test:"d", }, ]
相关分类