-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
What problem does this feature solve?
我有一个类似于qq聊天的窗体,聊天框需要缓存用户行为(滚动条位置、输入框内容等),keepalive渲染的组件都是同一个,只是加了不同的key,用keepalive可以实现我的需求的,当我关闭某个用户的聊天窗口时,配置include时缓存是没法清除;
我的组件结构如下:
<keep-alive :include="included">
<chat v-if="_interlocutor.Key===interlocutor" :interlocutor="_interlocutor"
:key="_interlocutor.Key" v-for="_interlocutor in interlocutors"/>
</keep-alive>
现在只能通过_vnode.componentInstance获取到keys,和cache,在程序中自己来处理。处理起来比较麻烦。
What does the proposed API look like?
看代码发现include和exclude的配置都是判断的组件name,能否增加include和exclude对key的支持。
Metadata
Metadata
Assignees
Labels
No labels