[admin-user] detail hide exam when page not loaded

This commit is contained in:
xiaomlove
2021-04-30 18:12:16 +08:00
parent 3737d684ee
commit b855fa4b0a
4 changed files with 8 additions and 7 deletions

View File

@@ -56,7 +56,7 @@
</template>
<script>
import { reactive, onMounted } from 'vue'
import { reactive, onMounted, onUnmounted } from 'vue'
import Header from './components/Header.vue'
import Footer from './components/Footer.vue'
import { useRouter } from 'vue-router'
@@ -80,10 +80,12 @@ export default {
routerName: router.name
})
onMounted(() => {
console.log(router)
})
router.beforeEach((to, from, next) => {
console.log("App beforeEach to", to)
onUnmounted(() => {
unwatch()
})
const unwatch = router.beforeEach((to, from, next) => {
if (to.path == '/login') {
// 如果路径是 /login 则正常执行
next()
@@ -97,7 +99,6 @@ export default {
next()
}
}
console.log('showMenu: ', !noMenu.includes(to.path))
state.showMenu = !noMenu.includes(to.path)
state.currentPath = to.path
document.title = pathMap[to.name]

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -106,7 +106,7 @@ export default {
</style>
<style>
.popper-user-box {
background: url('https://s.yezgea02.com/lingling-h5/static/account-banner-bg.png') 50% 50% no-repeat!important;
background: url('../assets/account-banner-bg.png') 50% 50% no-repeat!important;
background-size: cover!important;
border-radius: 0!important;
}

View File

@@ -135,7 +135,7 @@ export default {
const state = reactive({
loading: false,
baseInfo: {},
examInfo: {},
examInfo: null,
})
onMounted(() => {
fetchPageData()