如何监控selected
呢?
比如说$router.path=='/'
的时候再添加selected
呢
<tabbar style="position:fixed;z-index:999">
<tabbar-item selected link="/">
<img slot="icon" src="../../static/bottom/home.png">
<img slot="icon-active" src="../../static/bottom/home-ok.png">
<span slot="label">首页</span>
</tabbar-item>
<tabbar-item @on-item-click="aaa" link="/shopping">
<img slot="icon" src="../../static/bottom/shop.png">
<img slot="icon-active" src="../../static/bottom/shop-ok.png">
<span slot="label">商城</span>
</tabbar-item>
<tabbar-item link="/deal">
<img slot="icon" src="../../static/bottom/trade.png">
<img slot="icon-active" src="../../static/bottom/trade-ok.png">
<span slot="label">交易</span>
</tabbar-item>
<tabbar-item link="/my">
<img slot="icon" src="../../static/bottom/personal.png">
<img slot="icon-active" src="../../static/bottom/personal-ok.png">
<span slot="label">我的</span>
</tabbar-item>
</tabbar>
图标点击不同步
给图片加判断的同时给文字也加上判断就可以了
<tabbar-item link="/">
</tabbar-item>