feat: add the attribute routeCached to route to control cache the DOM corresponding to the route

This commit is contained in:
Jin Mao
2026-02-27 16:04:01 +08:00
parent 45b843f344
commit bd22793ceb
9 changed files with 301 additions and 83 deletions

View File

@@ -599,6 +599,13 @@ _注意:_ 排序仅针对一级菜单有效,二级菜单的排序需要在对
用于配置当前路由不使用基础布局,仅在顶级时生效。默认情况下,所有的路由都会被包裹在基础布局中(包含顶部以及侧边等导航部件),如果你的页面不需要这些部件,可以设置 `noBasicLayout` 为 `true`。
### domCached
- 类型:`boolean`
- 默认值:`false`
用于配置当前路由是否要将route对应dom元素缓存起来。对于一些复杂页面切换tab浏览器回流/重绘会导致卡顿, `domCached` 设为 `true`可解决该问题但是也有代价1、内存占用升高 2、vue的部分生命周期不会触发
## 路由刷新
路由刷新方式如下: