refactor(系统配置): ♻️ 系统配置
重构系统配置页面
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="layout-parent">
|
||||
<router-view v-slot="{ Component }">
|
||||
<transition :name="setTransitionName" mode="out-in">
|
||||
<keep-alive :include="getKeepAliveNames">
|
||||
<keep-alive :include="getKeepAliveNames" v-if="showView">
|
||||
<component :is="Component" :key="state.refreshRouterViewKey" class="w100" v-show="!isIframePage" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
@@ -14,7 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="layoutParentView">
|
||||
import { defineAsyncComponent, computed, reactive, onBeforeMount, onUnmounted, nextTick, watch, onMounted } from 'vue';
|
||||
import { defineAsyncComponent, computed, reactive, onBeforeMount, onUnmounted, nextTick, watch, onMounted,ref,provide } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useKeepALiveNames } from '/@/stores/keepAliveNames';
|
||||
@@ -39,6 +39,19 @@ const state = reactive<ParentViewState>({
|
||||
iframeList: [],
|
||||
});
|
||||
|
||||
//全局依赖刷新页面
|
||||
const showView = ref(true)
|
||||
/**
|
||||
* 刷新页面
|
||||
*/
|
||||
const refreshView=function () {
|
||||
showView.value = false // 通过v-if移除router-view节点
|
||||
nextTick(() => {
|
||||
showView.value = true // DOM更新后再通过v-if添加router-view节点
|
||||
})
|
||||
}
|
||||
provide('refreshView',refreshView)
|
||||
|
||||
// 设置主界面切换动画
|
||||
const setTransitionName = computed(() => {
|
||||
return themeConfig.value.animation;
|
||||
|
||||
Reference in New Issue
Block a user