style-directives: push updater into update chunks; add dynamic test;

pull/5923/head
pmurray73 6 years ago committed by Tan Li Hau
parent 69e566a746
commit e8a8f6399a

@ -923,6 +923,7 @@ export default class ElementWrapper extends Wrapper {
const updater = b`@set_style(${this.var}, "${name}", ${snippet}, false)`;
block.chunks.hydrate.push(updater);
block.chunks.update.push(updater);
});
}

@ -0,0 +1,12 @@
export default {
html: `
<p style="color: red;"></p>
`,
test({ assert, component, target }) {
component.myColor = 'blue';
assert.htmlEqual(target.innerHTML, `
<p style="color: blue;"></p>
`);
}
};

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