mirror of https://github.com/sveltejs/svelte
parent
2ed34f4fe2
commit
978a2bcae7
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<p>1</p>
|
||||||
|
<p>2</p>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
component.set({ foo: 2 });
|
||||||
|
assert.htmlEqual( target.innerHTML, `
|
||||||
|
<p>2</p>
|
||||||
|
<p>4</p>
|
||||||
|
` );
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,16 @@
|
|||||||
|
<p>{{foo}}</p>
|
||||||
|
<p>{{bar}}</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data: () => ({
|
||||||
|
foo: 1
|
||||||
|
}),
|
||||||
|
|
||||||
|
onrender () {
|
||||||
|
this.observe( 'foo', foo => {
|
||||||
|
this.set({ bar: foo * 2 });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,3 @@
|
|||||||
|
export default {
|
||||||
|
html: '<p>2</p>'
|
||||||
|
};
|
@ -0,0 +1,13 @@
|
|||||||
|
<p>{{foo}}</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data: () => ({
|
||||||
|
foo: 1
|
||||||
|
}),
|
||||||
|
|
||||||
|
onrender () {
|
||||||
|
this.set({ foo: 2 });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue