Commit d7283d9a authored by 晓彤's avatar 晓彤

修改

parent 5f846a5c
...@@ -8,9 +8,7 @@ const state = { ...@@ -8,9 +8,7 @@ const state = {
activeIndex: 0 activeIndex: 0
} }
], // 存储点击左侧导航栏后的导航名,作为标题显示头 ], // 存储点击左侧导航栏后的导航名,作为标题显示头
crumbs: [ crumbs: ['测试平台', '主页'], // 存储面包屑
'测试平台', '主页'
], // 存储面包屑
activeIndex: 0, // 当前活跃的标题下标 activeIndex: 0, // 当前活跃的标题下标
count: 0 // 下标增值变量 count: 0 // 下标增值变量
} }
...@@ -62,6 +60,7 @@ const mutations = { ...@@ -62,6 +60,7 @@ const mutations = {
const actions = { const actions = {
setNavs(context, nav) { setNavs(context, nav) {
console.log('setNav----', nav)
context.commit('setNav', nav) context.commit('setNav', nav)
} }
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import menu from './menu.json' import menu from './menu.json'
// import { getUserDetail } from '@/api/getLogin/' import { getUserDetail } from '@/api/getLogin/'
export default { export default {
name: 'Aside', name: 'Aside',
data() { data() {
...@@ -48,7 +48,6 @@ export default { ...@@ -48,7 +48,6 @@ export default {
methods: { methods: {
getNav() { getNav() {
this.nav = menu.menu this.nav = menu.menu
console.log('444', this.nav)
// 循环判断新列表里的是数据是否在旧列表里出现 // 循环判断新列表里的是数据是否在旧列表里出现
this.nav.forEach((element) => { this.nav.forEach((element) => {
var temp = {} var temp = {}
...@@ -57,12 +56,8 @@ export default { ...@@ -57,12 +56,8 @@ export default {
temp['title'] = element.title temp['title'] = element.title
temp['child'] = [] temp['child'] = []
element.child.forEach((children) => { element.child.forEach((children) => {
console.log('children: ', children)
var flag = false var flag = false
console.log(this.menuList)
this.menuList.forEach((menu) => { this.menuList.forEach((menu) => {
console.log('menu: ', menu)
console.log('children.path', children.path)
if (menu === children.path) { if (menu === children.path) {
flag = true flag = true
} }
...@@ -76,7 +71,7 @@ export default { ...@@ -76,7 +71,7 @@ export default {
console.log('newNav', this.newNav) console.log('newNav', this.newNav)
this.$store.dispatch('header/setNavs', { this.$store.dispatch('header/setNavs', {
// nav: this.nav // nav: this.nav
nav: this.newNav nav: []
}) })
}, },
...@@ -94,11 +89,10 @@ export default { ...@@ -94,11 +89,10 @@ export default {
}, },
// 获取用户详细信息 // 获取用户详细信息
async getUserDetail() { async getUserDetail() {
// getUserDetail().then((resp) => { getUserDetail().then((resp) => {
// this.menuList = resp.data.data.menuList this.menuList = resp.data.data.menuList
// console.log('menuList----', this.menuList) this.getNav()
// }) })
// this.getNav()
} }
}, },
computed: { computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment