router-link 點擊高亮變色(簡易辦法)


在路由 index.js 里面修改
 
 
  1. export default new Router({
  2.  
    mode:'history',
  3.  
    linkActiveClass:'is-active',
  4.  
    routes: [
  5.  
    {
  6.  
    path:'/about',
  7.  
    component:about
  8.  
    }
  9.  
    ]
  10.  
    })
 
紅色的是重點
然后在 header.vue 里面給is-active 設置 css樣式


免責聲明!

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



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