perf(layout): 使用 keep-alive优化页面性能
- 在 default.vue 文件中添加 keep-alive 组件,以提高页面渲染效率 - 此修改可以保留页面状态,减少重复渲染,提升用户体验
This commit is contained in:
parent
f3d5a3440c
commit
e23fed8c74
@ -2,7 +2,9 @@
|
|||||||
<main class="flex flex-col min-h-svh">
|
<main class="flex flex-col min-h-svh">
|
||||||
<AppHeader class="h-[var(--van-nav-bar-height)]" />
|
<AppHeader class="h-[var(--van-nav-bar-height)]" />
|
||||||
<div class="flex-1 flex flex-col">
|
<div class="flex-1 flex flex-col">
|
||||||
|
<keep-alive>
|
||||||
<slot />
|
<slot />
|
||||||
|
</keep-alive>
|
||||||
</div>
|
</div>
|
||||||
<AppFooter />
|
<AppFooter />
|
||||||
</main>
|
</main>
|
||||||
|
Loading…
Reference in New Issue
Block a user