mirror of https://github.com/sveltejs/svelte
Merge pull request #2191 from sveltejs/gh-2178
tweak semantics of reactive statementspull/2195/head
commit
d479d8a430
@ -0,0 +1,19 @@
|
||||
export default {
|
||||
html: `
|
||||
<p>count: 0</p>
|
||||
`,
|
||||
|
||||
test({ assert, component, target }) {
|
||||
component.count = 5;
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>count: 5</p>
|
||||
`);
|
||||
|
||||
component.count = 50;
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>count: 9</p>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
export let count = 0;
|
||||
|
||||
$: if (count >= 10) {
|
||||
count = 9;
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>count: {count}</p>
|
Loading…
Reference in new issue