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

perf: should patch string style when value is changed #1310

Merged
merged 3 commits into from
Jun 11, 2020

Conversation

underfin
Copy link
Member

@underfin underfin commented Jun 6, 2020

fix #1309

@@ -8,7 +8,9 @@ export function patchStyle(el: Element, prev: Style, next: Style) {
if (!next) {
el.removeAttribute('style')
} else if (isString(next)) {
style.cssText = next
if (prev !== next) {
style.cssText = next
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have a test to cover this pls?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm lazy on it....Yeah. I add test for it.

@yyx990803 yyx990803 merged commit d4e9b19 into vuejs:master Jun 11, 2020
@underfin underfin deleted the perf-patch-string-style branch June 16, 2020 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants