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

After

Width:  |  Height:  |  Size: 3.7 KiB

+1 -1
View File
@@ -106,7 +106,7 @@ export default {
</style> </style>
<style> <style>
.popper-user-box { .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; background-size: cover!important;
border-radius: 0!important; border-radius: 0!important;
} }
+1 -1
View File
@@ -135,7 +135,7 @@ export default {
const state = reactive({ const state = reactive({
loading: false, loading: false,
baseInfo: {}, baseInfo: {},
examInfo: {}, examInfo: null,
}) })
onMounted(() => { onMounted(() => {
fetchPageData() fetchPageData()