Commit d5366ff6d3332da05fe1d0d851b485831a0ee0b2
1 parent
55b836be
fix: set router-link-active for active link
Showing
3 changed files
with
10 additions
and
4 deletions
front-end/h5/src/components/core/styles/index.scss
| @@ -97,6 +97,14 @@ | @@ -97,6 +97,14 @@ | ||
| 97 | 97 | ||
| 98 | } | 98 | } |
| 99 | 99 | ||
| 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 | +} | ||
| 100 | 108 | ||
| 101 | 109 | ||
| 102 | .transparent-bg { | 110 | .transparent-bg { |
front-end/h5/src/router.js
| @@ -9,11 +9,9 @@ export default new Router({ | @@ -9,11 +9,9 @@ export default new Router({ | ||
| 9 | // mode: 'history', | 9 | // mode: 'history', |
| 10 | routes: [ | 10 | routes: [ |
| 11 | { | 11 | { |
| 12 | - path: '/work-manager', | 12 | + path: '/', |
| 13 | component: Home, | 13 | component: Home, |
| 14 | - name: 'work-manager', | ||
| 15 | redirect: '/work-manager/list', | 14 | redirect: '/work-manager/list', |
| 16 | - alias: '/', | ||
| 17 | children: [ | 15 | children: [ |
| 18 | { | 16 | { |
| 19 | path: '/work-manager/list', | 17 | path: '/work-manager/list', |
front-end/h5/src/views/work-manager/index.vue
| @@ -60,7 +60,7 @@ export default { | @@ -60,7 +60,7 @@ export default { | ||
| 60 | }, | 60 | }, |
| 61 | methods: { | 61 | methods: { |
| 62 | renderSidebar (menus) { | 62 | 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 |
| 64 | 64 | ||
| 65 | return menus.map(menu => ( | 65 | return menus.map(menu => ( |
| 66 | menu.children | 66 | menu.children |