fix: 修改细节
This commit is contained in:
parent
07eabd8869
commit
4991532883
@ -1,7 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<router-view>
|
<router-view>
|
||||||
<template #default="{ Component, route }">
|
<template #default="{ Component, route }">
|
||||||
<component :is="Component" :key="route.fullPath" />
|
<component
|
||||||
|
v-if="route.noKeepAlive"
|
||||||
|
:is="Component"
|
||||||
|
:key="route.fullPath"
|
||||||
|
/>
|
||||||
|
<keep-alive v-else>
|
||||||
|
<component :is="Component" :key="route.fullPath" />
|
||||||
|
</keep-alive>
|
||||||
</template>
|
</template>
|
||||||
</router-view>
|
</router-view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { useLoadingBar } from 'naive-ui'
|
import { useLoadingBar } from 'naive-ui'
|
||||||
import { MainView } from '@/layout/components/Main/index'
|
import { MainView } from '@/layout/components/Main/index'
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
//挂载在 window 方便与在js中使用
|
// 挂载在 window 方便与在js中使用
|
||||||
window['$loading'] = useLoadingBar()
|
window['$loading'] = useLoadingBar()
|
||||||
window['$loading'].finish()
|
window['$loading'].finish()
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user