在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ vux中tabbar數(shù)據(jù)記錄問題

vux中tabbar數(shù)據(jù)記錄問題

如何監(jiān)控selected 呢?

比如說$router.path=='/'的時(shí)候再添加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>

clipboard.png

圖標(biāo)點(diǎn)擊不同步

回答
編輯回答
北城荒

但是 第一個(gè) path 是無法被激活的 一直是灰色

2018年3月22日 19:10
編輯回答
貓小柒

給圖片加判斷的同時(shí)給文字也加上判斷就可以了

<tabbar-item link="/">

<img v-if="$route.path==`/`" slot="icon" src="../../static/bottom/home-ok.png">
<img v-else slot="icon" src="../../static/bottom/home.png">
<span  v-if="$route.path==`/`" slot="label" style="color:#4caf50">首頁</span>
<span v-else slot="label">首頁</span>

</tabbar-item>

2018年1月30日 05:45