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