spread on dynamic component - fixes #1307

pull/1308/head
Rich-Harris 7 years ago
parent db21e80a99
commit ee7f6769c4

@ -145,8 +145,10 @@ export default class Component extends Node {
}
});
block.addVariable(levels);
statements.push(deindent`
var ${levels} = [
${levels} = [
${initialProps.join(',\n')}
];

@ -0,0 +1,21 @@
export default {
data: {
props: {
a: 1,
},
},
html: `
<p>a: 1</p>
`,
test(assert, component, target) {
component.set({
props: {
a: 2,
},
});
assert.htmlEqual(target.innerHTML, `<p>a: 2</p>`);
},
};

@ -0,0 +1,13 @@
<:Component {Foo} {{...props}} />
<script>
import Foo from './Foo.html';
export default {
data() {
return {
Foo
};
}
};
</script>
Loading…
Cancel
Save