-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
v-html gets completely refreshed rather than patched when being re-rendered #4247
Comments
It's not just because computed style change. When the data changed, vue will rerender your app according to some strategies. Maybe we could apply diff to the nodes generated by the v-html rather than reset it. |
This is expected: |
Actually, in this case it should not be overwritten - we should cache the previous innerHTML and avoid setting it again if it stays the same. |
We could check the oldProp value with the new one here. https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/modules/dom-props.js#L23. I'll make a patch. |
Vue.js version
2.0.7
Reproduction Link
http://jsfiddle.net/v4f2typt/
Steps to reproduce
just look at the moving 'some html', the animation should run for 4 seconds, also check the element tab in the developer tools, where it is visible that the elements representing the v-html are changed
What is Expected?
the animation will complete, and the DOM element doesn't get reinserted
What is actually happening?
I guess, that the html in v-html gets removed and reinserted once the style has changed
The text was updated successfully, but these errors were encountered: