Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
584 views
in Technique[技术] by (71.8m points)

Vue keepalive 缓存清除问题,切换用户的时候更新key值,想知道怎么用?

vue移动端 当退出当前的A用户切换到新的B用户,B用户的数据还是A用户的,都是上个账号的缓存 ,请问大家是怎么解决的,很着急


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
<keep-alive :include='includes'>;//在合适的时候改变includes值就可以了。
通常会把includes存在vuex中,通过computed拿到。业务页面去修改store中的includes;
用法比较灵活,需要好好学一下。

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...