This commit is contained in:
gyq
2024-03-11 14:34:17 +08:00
parent 11290d1505
commit 0fbc614c61
13 changed files with 156 additions and 217 deletions

View File

@@ -5,28 +5,36 @@
<left-menu />
</div>
<div :class="{ view: route.path != '/login' }">
<router-view />
<!-- <div class="wrapper">
<div class="wrapper">
<div class="animation">
<router-view v-slot="{ Component }">
<transition :name="transitionName">
<!-- <transition :name="transitionName"> -->
<keep-alive :include="includeList">
<component :is="Component"></component>
</transition>
</keep-alive>
<!-- </transition> -->
</router-view>
</div>
</div> -->
</div>
</div>
</div>
</el-config-provider>
</template>
<script setup>
import { ref } from "vue";
import { ref, reactive, watch } from "vue";
import { useRouter, useRoute } from "vue-router"
import leftMenu from '@/components/leftMenu.vue'
const route = useRoute()
const includeList = reactive([]);
watch(route, (to) => {
if (to.meta.keepAlive) {
includeList.push(to.name);
}
});
let transitionName = ref();
let router = useRouter();
router.beforeEach((to, from) => {