diff options
Diffstat (limited to 'src/lib/Counter.svelte')
| -rw-r--r-- | src/lib/Counter.svelte | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/Counter.svelte b/src/lib/Counter.svelte new file mode 100644 index 0000000..e417505 --- /dev/null +++ b/src/lib/Counter.svelte @@ -0,0 +1,12 @@ +<script> + import { getStore } from './hmr-stores'; + export let id; + const count = getStore(id, 0); + export const increment = () => { + $count += 1 + }; +</script> + +<button class="px-8 py-4 w-52 text-red-500 bg-red-200 rounded-full" {id} on:click={increment}> + Clicks: {$count} +</button>
\ No newline at end of file |
