新增几个路由配置

This commit is contained in:
idiotalex@163.com 2020-11-03 15:24:33 +08:00
parent 129dc2b5e0
commit d6fbdb528e
8 changed files with 68 additions and 5 deletions

View File

@ -1,5 +1,6 @@
import axios from './config';
// 获取系统菜单列表
export function getSystemMenu() {
return axios({
url: 'menus_data.json',

View File

@ -9,7 +9,7 @@ export function login(params) {
})
}
// 修改昵称
// 修改密码
export function updatePwd(params) {
return axios({
url: '/user/updatePwd',

View File

@ -0,0 +1,12 @@
<template>
<div>404</div>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>

View File

@ -18,7 +18,7 @@
<a-layout-content
:style="{ margin: '24px 16px', padding: '24px', background: '#fff', minHeight: '280px' }"
>
Content
<router-view/>
</a-layout-content>
</a-layout>
</a-layout>

View File

@ -5,18 +5,20 @@
<a-icon type="apartment" />
<span>{{menu.title}}</span>
</span>
<a-menu-item v-for="subMenu in menu.childs" :key="subMenu.id">
<a-menu-item v-for="subMenu in menu.childs" :key="subMenu.id" @click="handleClick(subMenu.url)">
<span>{{subMenu.title}}</span>
</a-menu-item>
</a-sub-menu>
</a-menu>
</template>
<script>
import { mapGetters } from 'vuex';
import routeMenuList from '../../router/route-menu';
export default {
data() {
return {
routeList: routeMenuList
}
},
computed: {
@ -27,6 +29,17 @@ export default {
created() {
},
methods: {
//
checkRouteMenu(id) {
const tempList = this.routeList.filter(route => {
return route.id === id;
})
return tempList.length > 0;
},
handleClick(path) {
console.log(path)
this.$router.push(path)
}
}
}
</script>

View File

@ -0,0 +1,12 @@
<template>
<div>Node List</div>
</template>
<script>
export default {
data() {
return{
}
}
}
</script>

View File

@ -1,5 +1,6 @@
import Vue from 'vue';
import Router from 'vue-router';
import routeMenuList from './route-menu';
Vue.use(Router)
@ -14,7 +15,13 @@ export default new Router({
{
path: '/',
name: 'home',
component: () => import('../pages/layout')
component: () => import('../pages/layout'),
children: routeMenuList
},
{
path: '*',
name: '404',
component: () => import('../pages/404')
}
]
})

View File

@ -0,0 +1,18 @@
/**
* 路由菜单
* id 是后台菜单指定的 id
*/
const routeMenuList = [
{
path: '/node/list',
name: 'node-list',
component: () => import('../pages/node/list')
},
{
path: '/node/ssh',
name: 'node-ssh',
component: () => import('../pages/node/list')
}
]
export default routeMenuList