mui底部導航欄


mui是通過mui-active的class屬性來表示激活狀態(改變該按鈕的顏色)

 <router-link class="mui-tab-item mui-active" :to="{name:'member'}">
       <span class="mui-icon icon-myhuiyuan"></span>
       <span class="mui-tab-label">會員</span>
</router-link>

配合router-link的linkActiveClass屬性,就能在每次點擊后並且跳轉后,改變樣式。

let router = new VueRouter({ linkActiveClass:'mui-active', //router-link成功后,就給該按鈕加上mui-active屬性。 routes: [ //VueRouter:配置路由規則
        { path: '/', redirect: { name: 'home' } }, //重定向
        { name: 'home', path: '/home', component: Home },//首頁
        { name:'member',path:'/member',component: Member}, //會員
        { name: 'shopcart',path:'/shopcart',component:Shopcart}, //購物車
        { name: 'search',path:'/search',component:Search}, //查找
        { name:'news.list',path:'/news/list',component:NewsList}, //新聞列表
        { name:'news.detail',path:'/news/detail',component:NewsDetail}, //新聞詳情
 ] });

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM