Allow including/excluding by key in keep-alive
What problem does this feature solve?
Want more flexible caching components
What does the proposed API look like?
<keep-alive include="detail-id-1,detail-id-2">
<component :is="Component" :key="key" />
</keep-alive>
Source code:232 line
const name = getName(comp);
const { include, exclude, max } = props;
if (
(include && (!name || !matches(include, name))) ||
(exclude && name && matches(exclude, name))
) {
return (current = vnode)
}
const key = vnode.key == null ? comp : vnode.key
const cachedVNode = cache.get(key)
modify:
const name = vnode.key || getName(comp)
The "key" value is preferred as the include or exclude condition
This was asked for Vue 2 https://github.com/vuejs/vue/issues/8028
Closed, tracking here https://github.com/vuejs/rfcs/pull/284
Closed, tracking here vuejs/rfcs#284
Any progress?
Closed, tracking here vuejs/rfcs#284
Is there anything holding this up?