mirror of https://github.com/sveltejs/svelte
11 lines
296 B
11 lines
296 B
<script>
|
|
import Button from './Button.svelte';
|
|
export let count = 0;
|
|
let clickHandler = () => count += 1;
|
|
function updateHandler(){
|
|
clickHandler = () => count += 10;
|
|
}
|
|
</script>
|
|
|
|
<button on:click={updateHandler}>update handler</button>
|
|
<Button on:click|once={clickHandler}>{count}</Button> |