Commit d5366ff6d3332da05fe1d0d851b485831a0ee0b2

Authored by ly525
1 parent 55b836be

fix: set router-link-active for active link

front-end/h5/src/components/core/styles/index.scss
... ... @@ -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 110 .transparent-bg {
... ...
front-end/h5/src/router.js
... ... @@ -9,11 +9,9 @@ export default new Router({
9 9 // mode: 'history',
10 10 routes: [
11 11 {
12   - path: '/work-manager',
  12 + path: '/',
13 13 component: Home,
14   - name: 'work-manager',
15 14 redirect: '/work-manager/list',
16   - alias: '/',
17 15 children: [
18 16 {
19 17 path: '/work-manager/list',
... ...
front-end/h5/src/views/work-manager/index.vue
... ... @@ -60,7 +60,7 @@ export default {
60 60 },
61 61 methods: {
62 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 65 return menus.map(menu => (
66 66 menu.children
... ...