"vux": "^0.1.3-rc5"
iOS
<div v-cloak class="page">
<router-view keep-alive></router-view>
<tabbar v-if="isIndex">
<tabbar-item :link="{name:'recommend'}">
<i slot="icon" class="tab-icon tab-icon-recommend"></i>
<span slot="label">推荐</span>
</tabbar-item>
<tabbar-item :link="{name:'raise'}">
<i slot="icon" class="tab-icon tab-icon-kids"></i>
<span slot="label">育儿</span>
</tabbar-item>
<tabbar-item :link="{name:'mine'}">
<i slot="icon" class="tab-icon tab-icon-more"></i>
<span slot="label">更多</span>
</tabbar-item>
</tabbar>
</div>
每次我从二级页面回到一级页面时,tabbar默认选中第一项
你要是根据name来设置,就直接这样:
<tabbar-item :selected="$route.name === 'recommend'">
这样设置没问题。感谢
厉害
Most helpful comment
你要是根据name来设置,就直接这样: