active-class?是 vue-router 模塊的?router-link
?組件的屬性,當(dāng)?router-link
?標(biāo)簽被點(diǎn)擊時(shí)將會(huì)應(yīng)用這個(gè)樣式。
- 單獨(dú)在?
router-link
?標(biāo)簽上使用?active-class
?屬性 -
<router-link to="/about" active-class="active">about</router-link>
最后,為您選中的鏈接設(shè)置樣式:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-668419.html
-
a.router-link-exact-active { color: plum; } .active { font-size: 16px; font-weight: bold; }
點(diǎn)擊后,無(wú)論怎么刷新頁(yè)面,樣式效果都不會(huì)去掉,除非跳轉(zhuǎn)到其他頁(yè)面。。(這一點(diǎn)還挺不錯(cuò))文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-668419.html
到了這里,關(guān)于Vue Router active-class 屬性的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!