Skip to content

Commit d5366ff

Browse files
committed
fix: set router-link-active for active link
1 parent 55b836b commit d5366ff

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

front-end/h5/src/components/core/styles/index.scss

+8
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@
9797

9898
}
9999

100+
.default-router-link {
101+
color: rgba(0, 0, 0, 0.65);
102+
}
103+
.router-link-active {
104+
color: #1890ff !important;
105+
background-color: transparent;
106+
text-decoration: none;
107+
}
100108

101109

102110
.transparent-bg {

front-end/h5/src/router.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ export default new Router({
99
// mode: 'history',
1010
routes: [
1111
{
12-
path: '/work-manager',
12+
path: '/',
1313
component: Home,
14-
name: 'work-manager',
1514
redirect: '/work-manager/list',
16-
alias: '/',
1715
children: [
1816
{
1917
path: '/work-manager/list',

front-end/h5/src/views/work-manager/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
},
6161
methods: {
6262
renderSidebar (menus) {
63-
const renderLabel = menu => menu.routerName ? <router-link to={{ name: menu.routerName }} >{menu.label}</router-link> : menu.label
63+
const renderLabel = menu => menu.routerName ? <router-link class="default-router-link" to={{ name: menu.routerName }}>{menu.label}</router-link> : menu.label
6464
6565
return menus.map(menu => (
6666
menu.children

0 commit comments

Comments
 (0)