|
|
@@ -1,9 +1,8 @@
|
|
|
<template>
|
|
|
- <router-view v-if="isRouterAlive" />
|
|
|
+ <router-view />
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, nextTick } from 'vue'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
import { dialog } from '@/utils/vant'
|
|
|
import { useLogin } from '@/business/login'
|
|
|
@@ -11,14 +10,9 @@ import eventBus from '@/services/bus'
|
|
|
|
|
|
const { userLogout } = useLogin()
|
|
|
const { backHomePage } = useNavigation()
|
|
|
-const isRouterAlive = shallowRef(true) // 用于页面重新渲染
|
|
|
|
|
|
const quit = (showLogin = false) => {
|
|
|
- isRouterAlive.value = false
|
|
|
backHomePage({ tabName: 'home', showLogin })
|
|
|
- nextTick(() => {
|
|
|
- isRouterAlive.value = true
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
// 接收用户登出通知
|