Commit 60e19efc authored by 张伯涛's avatar 张伯涛

/Home改为/NLTHome

parent 5ffe5829
<template> <template>
<section class="app-main"> <section class="app-main">
<div class="container" :style="{background: $route.path === '/Home' ? 'unset' : '#FFFFFF'}"> <div class="container" :style="{background: $route.path === '/NLTHome' ? 'unset' : '#FFFFFF'}">
<transition name="fade-transform" mode="out-in"> <transition name="fade-transform" mode="out-in">
<router-view :key="key" class="app-container-bg" :style="{background: $route.path === '/Home' ? 'unset' : '#FFFFFF'}"/> <router-view :key="key" class="app-container-bg" :style="{background: $route.path === '/NLTHome' ? 'unset' : '#FFFFFF'}"/>
</transition> </transition>
</div> </div>
</section> </section>
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
}, },
methods: { methods: {
closeMenuItem(item) { closeMenuItem(item) {
if (item === '/Home') { if (item === '/NLTHome') {
this.$emit('closeMenu') this.$emit('closeMenu')
} }
}, },
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
// When there is only one child router, the child router is displayed by default // When there is only one child router, the child router is displayed by default
console.log('showingChildren', showingChildren) console.log('showingChildren', showingChildren)
if (showingChildren.length === 1) { if (showingChildren.length === 1) {
if (showingChildren[0].path === '/Home') { if (showingChildren[0].path === '/NLTHome') {
return true return true
} }
return false return false
...@@ -111,24 +111,24 @@ export default { ...@@ -111,24 +111,24 @@ export default {
return false return false
}, },
isHome(children = [], parent) { // isHome(children = [], parent) {
const showingChildren = children.filter(item => { // const showingChildren = children.filter(item => {
if (item.hidden) { // if (item.hidden) {
return false // return false
} else { // } else {
// Temp set(will be used if only has one showing child) // // Temp set(will be used if only has one showing child)
this.onlyOneChild = item // this.onlyOneChild = item
return true // return true
} // }
}) // })
if (showingChildren.length === 1) { // if (showingChildren.length === 1) {
if (showingChildren[0].path === '/Home') { // if (showingChildren[0].path === '/Home') {
return true // return true
} // }
return false // return false
} // }
return false // return false
}, // },
resolvePath(routePath) { resolvePath(routePath) {
if (isExternal(routePath)) { if (isExternal(routePath)) {
return routePath return routePath
......
...@@ -36,6 +36,7 @@ const permission = { ...@@ -36,6 +36,7 @@ const permission = {
console.log('firstChild', firstChild) console.log('firstChild', firstChild)
accessedRoutes.push({ path: '*', redirect: '/404', hidden: true }) accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
accessedRoutes.push({ path: '/', redirect: firstChild, hidden: true }) accessedRoutes.push({ path: '/', redirect: firstChild, hidden: true })
console.log('accessedRoutes', accessedRoutes)
commit('SET_ROUTES', accessedRoutes) commit('SET_ROUTES', accessedRoutes)
} }
const routers = { accessedRoutes: accessedRoutes, getRouters: newRouters } const routers = { accessedRoutes: accessedRoutes, getRouters: newRouters }
......
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