首页 > 其他 > 详细

vue子路由选中后父路由样式消失解决办法

时间:2019-05-24 13:16:38      阅读:817      评论:0      收藏:0      [点我收藏+]

一、在子路由前面加上父路由路径

{

path: "/foundMusic",

component: FoundMusic,

children: [

{ path: "/foundMusic/newdisc", component: NewDisc },

{ path: "/foundMusic/radio", component: Radio },

{ path: "/foundMusic/rank", component: Rank },

{ path: "/foundMusic/recommend", component: Recommend },

{ path: "/foundMusic/singer", component: Singer },

{ path: "/foundMusic/songs", component: Songs },

] }

二、使用.router-link-active代替.router-link-exact-active。

.router-link-active {

background: black;

&::after {

content: ‘‘;

display: block;

position: absolute;

bottom: 0;

left: 50%;

border-width: 5px;

border-color: transparent transparent red transparent;

border-style: solid; //利用伪类使选中路由添加红色三角样式

}

}

vue子路由选中后父路由样式消失解决办法

原文:https://www.cnblogs.com/jeromeNie/p/10917426.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!