vue van-tabs 设置默认选项
<van-tabs type="card" animated swipeable sticky color:red v-model="detail.postname"> <van-tab v-for="(item,index) in tabs" :title="item.title" :key="item.name" :name="item.name" > <img :src="item.content" /> </van-tab> </van-tabs>
tabs: [ { name: '生产岗', title: '生产岗', content: '../../static/img/role_scg.png' }, { name: '营销岗', title: '营销岗', content: '../../static/img/role_yxg.png' }, { name: '服务岗', title: '服务岗', content: '../../static/img/role_fwg.png' }, { name: '研发岗', title: '研发岗', content: '../../static/img/role_yfg.png' }, { name: '管理岗', title: '管理岗', content: '../../static/img/role_glg.png' }, ],
查找了很多,后来发现很简单,设置了
v-model就可以设置默认选项