diff options
Diffstat (limited to 'examples/with-markdown/src/components/SvelteCounter.svelte')
| -rw-r--r-- | examples/with-markdown/src/components/SvelteCounter.svelte | 22 | 
1 files changed, 22 insertions, 0 deletions
| diff --git a/examples/with-markdown/src/components/SvelteCounter.svelte b/examples/with-markdown/src/components/SvelteCounter.svelte new file mode 100644 index 000000000..8d6b3f5e1 --- /dev/null +++ b/examples/with-markdown/src/components/SvelteCounter.svelte @@ -0,0 +1,22 @@ + +<script> +  let children; +  let count = 0; + +  function add() { +		count += 1; +	} + +  function subtract() { +		count -= 1; +	} +</script> + +<div class="counter"> +    <button on:click={subtract}>-</button> +    <pre>{ count }</pre> +    <button on:click={add}>+</button> +</div> +<div class="children"> +    <slot /> +</div> | 
