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

/Home改为/NLTHome

parent 5ffe5829
<template>
<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">
<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>
</div>
</section>
......
......@@ -76,7 +76,7 @@ export default {
},
methods: {
closeMenuItem(item) {
if (item === '/Home') {
if (item === '/NLTHome') {
this.$emit('closeMenu')
}
},
......@@ -97,7 +97,7 @@ export default {
// When there is only one child router, the child router is displayed by default
console.log('showingChildren', showingChildren)
if (showingChildren.length === 1) {
if (showingChildren[0].path === '/Home') {
if (showingChildren[0].path === '/NLTHome') {
return true
}
return false
......@@ -111,24 +111,24 @@ export default {
return false
},
isHome(children = [], parent) {
const showingChildren = children.filter(item => {
if (item.hidden) {
return false
} else {
// Temp set(will be used if only has one showing child)
this.onlyOneChild = item
return true
}
})
if (showingChildren.length === 1) {
if (showingChildren[0].path === '/Home') {
return true
}
return false
}
return false
},
// isHome(children = [], parent) {
// const showingChildren = children.filter(item => {
// if (item.hidden) {
// return false
// } else {
// // Temp set(will be used if only has one showing child)
// this.onlyOneChild = item
// return true
// }
// })
// if (showingChildren.length === 1) {
// if (showingChildren[0].path === '/Home') {
// return true
// }
// return false
// }
// return false
// },
resolvePath(routePath) {
if (isExternal(routePath)) {
return routePath
......
......@@ -36,6 +36,7 @@ const permission = {
console.log('firstChild', firstChild)
accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
accessedRoutes.push({ path: '/', redirect: firstChild, hidden: true })
console.log('accessedRoutes', accessedRoutes)
commit('SET_ROUTES', accessedRoutes)
}
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