mirror of https://github.com/sveltejs/svelte
parent
6e5d03c417
commit
acb64e1c59
@ -0,0 +1,15 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<p>1 + 2 = 3</p>
|
||||||
|
<p>Times calculated: 1</p>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test({ assert, component, target }) {
|
||||||
|
component.a = 3;
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<p>3 + 2 = 5</p>
|
||||||
|
<p>Times calculated: 2</p>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,15 @@
|
|||||||
|
<script>
|
||||||
|
export let a = 1;
|
||||||
|
export let b = 2;
|
||||||
|
let c;
|
||||||
|
|
||||||
|
let count = 0;
|
||||||
|
|
||||||
|
$: {
|
||||||
|
c = a + b;
|
||||||
|
count = count + 1;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>{a} + {b} = {c}</p>
|
||||||
|
<p>Times calculated: {count}</p>
|
Loading…
Reference in new issue