mirror of https://github.com/sveltejs/svelte
parent
1998739524
commit
253615fed5
@ -1,8 +1,8 @@
|
|||||||
<script>
|
<script>
|
||||||
export let x = 0;
|
export let x = 0;
|
||||||
|
|
||||||
$: x *= 2;
|
$: x *= 2;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button on:click='{() => x += 1}'>+1</button>
|
<button on:click='{() => x += 1}'>+1</button>
|
||||||
<p>count:{x}</p>
|
<p>count: {x}</p>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<script>
|
<script>
|
||||||
export let x = 0;
|
export let x = 0;
|
||||||
|
|
||||||
$: x++;
|
$: x++;
|
||||||
|
|
||||||
function onClick() {
|
function onClick() {
|
||||||
x += 1;
|
x += 1;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button on:click='{() => x += 1}'>+1</button>
|
<button on:click='{() => x += 1}'>+1</button>
|
||||||
<p>count:{x}</p>
|
<p>count: {x}</p>
|
||||||
|
Loading…
Reference in new issue