vue3某一个路由切换,导致所有路由页面均变成空白页

index1.vue

html 复制代码
<template>
	<div>展示区域1</div>
	<div>展示区域2</div>
</template>

index2.vue

html 复制代码
<template>
	<div>展示区域1</div>
</template>

当index1切换到别的路由时,会变成空白页,再切换所有页面都是空白页 ,只有刷新 后,才能恢复正常;

而通过index切换路由时,是正常的

可能是Vue 3.5.13 中使用两个 div 作为根节点导致页面空白的可能原因

哪怕是写一个div,加个<!--注释-->注释也不行

版本:

js 复制代码
"dependencies": {
		"@axolo/json-editor-vue": "^0.3.2",
		"@chenfengyuan/vue-qrcode": "^2.0.0",
		"@element-plus/icons-vue": "^2.0.10",
		"@form-create/element-ui": "3.2.16",
		"@fullcalendar/adaptive": "^6.1.19",
		"@fullcalendar/core": "^6.1.19",
		"@fullcalendar/daygrid": "^6.1.19",
		"@fullcalendar/interaction": "^6.1.19",
		"@fullcalendar/vue3": "^6.1.19",
		"@microsoft/fetch-event-source": "^2.0.1",
		"@popperjs/core": "2.11.8",
		"@vueuse/core": "^10.4.1",
		"@wangeditor-next/editor": "5.6.34",
		"@wangeditor-next/editor-for-vue": "5.1.14",
		"autoprefixer": "^10.4.7",
		"axios": "^1.3.3",
		"codemirror": "5.65.5",
		"cropperjs": "^1.5.12",
		"crypto-js": "^3.1.9-1",
		"disable-devtool": "^0.3.8",
		"driver.js": "^0.9.8",
		"echarts": "^5.4.1",
		"element-plus": "2.5.5",
		"exif-js": "^2.3.0",
		"form-create-designer": "3.2.11-oem",
		"highlight.js": "^11.7.0",
		"image-conversion": "^2.1.1",
		"js-base64": "^3.7.7",
		"js-cookie": "^3.0.1",
		"json-editor-vue3": "^1.1.1",
		"lodash": "^4.17.21",
		"marked": "^12.0.2",
		"markmap-common": "0.15.6",
		"markmap-lib": "0.15.8",
		"markmap-view": "0.15.8",
		"mitt": "^3.0.0",
		"moment": "^2.30.1",
		"nprogress": "^0.2.0",
		"pinia": "2.0.32",
		"postcss": "8.4.40",
		"print-js": "^1.6.0",
		"qrcode": "1.5.1",
		"qs": "^6.11.0",
		"screenfull": "^6.0.2",
		"sm-crypto": "^0.3.12",
		"sortablejs": "^1.15.0",
		"splitpanes": "^3.1.5",
		"tailwindcss": "3.4.17",
		"v-calendar": "3.1.2",
		"vue": "3.5.13",
		"vue-clipboard3": "^2.0.0",
		"vue-echarts": "7.0.3",
		"vue-i18n": "9.2.2",
		"vue-router": "^4.1.6",
		"vue3-tree-org": "^4.2.2",
		"vue3-video-play": "1.3.1-beta.6",
		"vuedraggable": "^4.1.0",
		"xlsx": "^0.18.5"
	},
	"devDependencies": {
		"@swc/core": "1.6.13",
		"@types/crypto-js": "^4.2.2",
		"@types/markdown-it": "^14.1.1",
		"@types/node": "^18.14.0",
		"@types/nprogress": "^0.2.0",
		"@types/sm-crypto": "^0.3.4",
		"@types/sortablejs": "^1.15.0",
		"@typescript-eslint/eslint-plugin": "^5.53.0",
		"@typescript-eslint/parser": "^5.53.0",
		"@vitejs/plugin-vue": "^4.0.0",
		"@vue/compiler-sfc": "^3.2.47",
		"consola": "^2.15.3",
		"cross-env": "7.0.3",
		"daisyui": "4.11.1",
		"eslint": "^8.34.0",
		"eslint-plugin-vue": "^9.9.0",
		"pinia-plugin-persist": "^1.0.0",
		"prettier": "2.8.4",
		"sass": "1.58.3",
		"terser": "^5.31.1",
		"typescript": "^4.9.5",
		"unplugin-auto-import": "^0.13.0",
		"vite": "^4.3.3",
		"vite-plugin-compression": "^0.5.1",
		"vite-plugin-style-import": "^2.0.0",
		"vite-plugin-top-level-await": "^1.3.0",
		"vite-plugin-vue-setup-extend": "^0.4.0",
		"vue-eslint-parser": "^9.1.0"
	},
相关推荐
拖孩12 分钟前
# 我又用 AI 做了个小程序:24 天,记录我这辈子认识的人
前端·后端·微信小程序
徐小夕21 分钟前
深度拆解 Design Agent:LangChain 出品,AI 设计从「好看」走向「可用」
前端·vue.js·github
1-1=044 分钟前
Vue 表单数据和过滤器
前端·javascript·vue.js
oil欧哟1 小时前
Oil UI 的设计思路与日常使用方式:让 AI 摆脱默认模板并保持多页面风格统一
前端
恋猫de小郭1 小时前
Jetpack Compose 1.13 发布,憋了这么久终有交代了
android·前端·flutter
头发还在的女程序员2 小时前
智慧物业源码解析:房屋档案与业主变更怎样保持历史业务连续
前端·javascript·vue.js·物业管理·小区物业·智慧物业
JianZhen✓2 小时前
电商 SKU 选择器:后端只给扁平列表,前端怎么反推规格矩阵并做到 O(1) 命中
前端·矩阵·状态模式
feixing_fx10 小时前
第一个 JS 程序:在浏览器控制台和 Node 中分别运行
开发语言·前端·javascript·前端框架·ecmascript
feixing_fx12 小时前
变量与声明:let、const、var 的选择边界
开发语言·前端·javascript·前端框架
JavaGuide14 小时前
Cloudflare 开源的这套神级安全审计 Skill 太好用了!
前端·后端