路由javascript
export default new Router({ linkActiveClass: 'active',//設置 連接激活時使用的 CSS 類名。默認值能夠經過路由的構造選項 來全局配置 routes: [ ] }) linkActiveClass
csscss
.nav .active {
color: #ffbb22;
}
模版html
<div class="nav"> <router-view></router-view> <router-link class="nav-item" to="/nav1">nav1</router-link> <router-link class="nav-item" to="/nav2">nav2</router-link> <router-link class="nav-item" to="/nav3">nav3</router-link> </div>