-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
children not update #1587
Comments
@yyx990803 @HcySunYang <span v-if="value%2 === 0" key="1">world</span>
<span v-if="value%2 !== 0" key="1">hello</span> |
To be honest, this is a wrong usage. |
This is a very conventional way of use. If using <span v-if="value%2 === 0" key="1">world</span>
<span v-else key="1">hello</span> If let users understand patchFlag, this is a big mental burden(心智负担😓). |
Look like we need do some static analysis for same keys element and add corresponding patchFlag to it. |
In Vue 3 you should never do this. There's no convincing reason to force the same key on two branches. We should throw warnings if the user tries to do this. |
Version
3.0.0-beta.21
Reproduction link
https://jsbin.com/kazolagosa/edit?html,output
Steps to reproduce
slot not update when use two
v-if
.we can use
v-else-if
orkey
to slove it. but bring mental burden to users. hahahWhat is expected?
slot update
What is actually happening?
slot not update
The text was updated successfully, but these errors were encountered: