mirror of https://github.com/sveltejs/svelte
tweak semantics of reactive statements - fixes #2178
parent
f2a48145a8
commit
8e4464166a
@ -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