Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-core): ensure keep-alive deep-watches include/exlude props (fix #2550) #2551

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

LinusBorg
Copy link
Member

@LinusBorg LinusBorg commented Nov 3, 2020

We currently watch components like this:

watch(() => [props.include, props.exclude], ....)

Which works when include / exclude are eithe refs or receive immutable values.

If either is a reactive([]), the watch would not be triggered.

Addind deep: true fixes the issue.

to pick up changes when provided with a reactive array instead of a ref
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Size report

Path Size
vue.global.prod.js 40.15 KB (-0.01% 🔽)
runtime-dom.global.prod.js 26.43 KB (-0.02% 🔽)
size-check.global.prod.js 15.95 KB (0%)

@LinusBorg LinusBorg changed the title fix(runtime-core): ensure keep-alive deep-watches include/explude props fix(runtime-core): ensure keep-alive deep-watches include/exlude props (fix #2550) Nov 3, 2020
@lgd8981289
Copy link

lgd8981289 commented Nov 4, 2020

Thanks, but I want to know how I can solve this problem in the existing version。

@LinusBorg
Copy link
Member Author

LinusBorg commented Nov 4, 2020

Return a fresh array instead of mutating the existing one.

@LinusBorg LinusBorg added has workaround A workaround has been found to avoid the problem and removed has workaround A workaround has been found to avoid the problem labels Nov 4, 2020
@yyx990803 yyx990803 merged commit 421205d into master Nov 30, 2020
@yyx990803 yyx990803 deleted the linusborg/keep-alive-deep-watch-fix-2550 branch November 30, 2020 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeepAlive include Property binding responsive data(KeepAlive include 属性绑定响应式数据的问题)
3 participants