20260817225227
This commit is contained in:
1 parent
d3acc7d28f
commit
b90ae89b0e
39 files changed
+3861
-353
No files matched your search
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* 页签缓存标识:把路由 fullPath 映射为 keep-alive include 可匹配的唯一组件名。
|
||||
*
|
||||
* 背景:keep-alive 的 include/exclude 只能按「组件名」匹配,无法按 :key(fullPath)精确销毁。
|
||||
* 对于「同一组件被不同参数复用」(如 /detail/1、/detail/2 共用 DetailPage)的场景,
|
||||
* 需要让每个 fullPath 拥有独立的组件类型与组件名,include 才能按参数精确销毁其实例,
|
||||
* 同时不同参数天然成为多个独立缓存。
|
||||
*/
|
||||
export function cacheKeyOf(fullPath) {
|
||||
return `page_${encodeURIComponent(fullPath)}`
|
||||
}
|
||||
Reference in new issue
Block a user