mirror of https://github.com/sveltejs/svelte
Merge pull request #488 from sveltejs/component-binding-blowback
prevent binding blowback on initial renderpull/497/head
commit
a9f18b5e9f
@ -0,0 +1 @@
|
||||
<p>does nothing</p>
|
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
test ( assert, component ) {
|
||||
let count = 0;
|
||||
|
||||
component.observe( 'bar', () => {
|
||||
count += 1;
|
||||
});
|
||||
|
||||
component.set({ x: true });
|
||||
assert.equal( count, 1 );
|
||||
|
||||
component.destroy();
|
||||
}
|
||||
};
|
@ -0,0 +1,22 @@
|
||||
{{#if x}}
|
||||
<Widget bind:foo='bar.baz'/>
|
||||
{{/if}}
|
||||
|
||||
<script>
|
||||
import Widget from './Widget.html';
|
||||
|
||||
export default {
|
||||
data: function () {
|
||||
return {
|
||||
x: false,
|
||||
bar: {
|
||||
baz: 42
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
Widget
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue