vue点击当前路由高亮小案例
更新时间:2019年09月26日 10:44:57 作者:小羽向前跑
这篇文章主要为大家详细介绍了vue点击当前路由高亮小案例,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
本文实例为大家分享了vue点击当前路由高亮的具体代码,供大家参考,具体内容如下
功能展示:
组件代码:
标签上加exact
.router-link-active{ background: rgba(255,255,255,0.8); color: gray; }
<template> <nav> <ul> <li> <router-link to="/" exact>博客</router-link> <router-link to="/AddBlog" exact>写博客</router-link> </li> </ul> </nav> </template> <script> export default { name: "bolgheader" } </script> <style scoped> ul{ list-style-type: none; text-align: center; margin:0; } li{ display: inline-block; margin:0 10px; } a{ color:rgb(102, 119, 204); text-decoration: none; padding:12px; border-radius: 5px; font-size:20px; } nav{ background: #eee; padding: 30px 0; margin-bottom: 40px; } .router-link-active{ background: rgba(255,255,255,0.8); color: gray; } </style>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
相关文章
详解vue-cli快速构建vue应用并实现webpack打包
这篇文章主要介绍了详解vue-cli快速构建vue应用并实现webpack打包,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2017-12-12vue this.$router.go(-1);返回时如何带参数
这篇文章主要介绍了vue this.$router.go(-1);返回时如何带参数问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教2023-12-12使用this.$router.go(-1)遇到的一些问题及解决
这篇文章主要介绍了使用this.$router.go(-1)遇到的一些问题及解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教2023-12-12
最新评论