mirror of https://github.com/sveltejs/svelte
reverse pre and post to fix deferrerd observers (fixes #441)
parent
d105b6ba4c
commit
7219202471
@ -0,0 +1,22 @@
|
||||
export default {
|
||||
'skip-ssr': true,
|
||||
|
||||
data: {
|
||||
value: 'hello!'
|
||||
},
|
||||
|
||||
html: `
|
||||
<p>hello!</p>
|
||||
<p>hello!</p>
|
||||
`,
|
||||
|
||||
test ( assert, component, target ) {
|
||||
component.set({ value: 'goodbye!' });
|
||||
assert.htmlEqual( target.innerHTML, `
|
||||
<p>goodbye!</p>
|
||||
<p>goodbye!</p>
|
||||
` );
|
||||
|
||||
component.destroy();
|
||||
}
|
||||
};
|
@ -0,0 +1,14 @@
|
||||
<p ref:a>{{value}}</p>
|
||||
<p ref:b></p>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
oncreate () {
|
||||
this.observe( 'value', () => {
|
||||
this.refs.b.textContent = this.refs.a.textContent;
|
||||
}, {
|
||||
defer: true
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue