Fix the problem of hot update error report caused by transition components

This commit is contained in:
chuan_wuhao 2022-08-29 11:51:20 +08:00
parent 4af5d743f1
commit 11dd9c3559
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<router-view v-slot="{ Component, route }"> <router-view v-slot="{ Component, route }">
<transition name="fade-transform" mode="out-in" appear> <transition name="fade-transform" mode="out-in" appear>
<keep-alive include="Layout"> <keep-alive include="layout">
<component :is="Component" :key="route" /> <component :is="Component" :key="route" />
</keep-alive> </keep-alive>
</transition> </transition>

View File

@ -28,10 +28,10 @@ export default defineConfig(async ({ mode }) => {
plugins: [ plugins: [
vue({ reactivityTransform: true }), vue({ reactivityTransform: true }),
vueJsx(), vueJsx(),
ViteInspect(), // 仅适用于开发模式(检查 Vite 插件的中间状态) ViteInspect(), // 仅适用于开发模式(检查 `Vite` 插件的中间状态)
VueI18nPlugin(), VueI18nPlugin(),
useAutoImport(), await useAutoImport(),
useViteComponents(), await useViteComponents(),
useViteCompression(), useViteCompression(),
useVueI18nPlugin(), useVueI18nPlugin(),
useHTMLTitlePlugin(), useHTMLTitlePlugin(),
@ -46,7 +46,7 @@ export default defineConfig(async ({ mode }) => {
css: { css: {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {
additionalData: '@import "./src/styles/mixins.scss";', // 全局mixin additionalData: '@import "./src/styles/mixins.scss";', // 全局 `mixin`
}, },
}, },
}, },