Fixed unnecessarily style properties update

pull/3439/head
Almaz 5 years ago
parent d42a8627cd
commit 012ed466d7

@ -35,8 +35,7 @@ export default class StyleAttributeWrapper extends AttributeWrapper {
} else {
const snippet = chunk.render();
add_to_set(prop_dependencies, chunk.dependencies);
add_to_set(prop_dependencies, chunk.dynamic_dependencies());
return chunk.get_precedence() <= 13 ? `(${snippet})` : snippet;
}
})

@ -0,0 +1,47 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
detach,
element,
init,
insert,
noop,
safe_not_equal,
set_style
} from "svelte/internal";
function create_fragment(ctx) {
var div;
return {
c() {
div = element("div");
set_style(div, "color", color);
},
m(target, anchor) {
insert(target, div, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div);
}
}
};
}
let color = 'red';
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, []);
}
}
export default Component;

@ -0,0 +1,5 @@
<script>
let color = 'red';
</script>
<div style="color: {color}"></div>
Loading…
Cancel
Save