aboutsummaryrefslogtreecommitdiff
path: root/packages/astro/e2e/fixtures/nested-in-vue/src/components/SvelteCounter.svelte
blob: 733f58076a24af0f35a5829485a1825bf5224bbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

<script>
	export let id;
  let children;
  let count = 0;

  function add() {
		count += 1;
	}

  function subtract() {
		count -= 1;
	}
</script>

<div {id} class="counter">
  <button class="decrement" on:click={subtract}>-</button>
  <pre id={`${id}-count`}>{ count }</pre>
  <button id={`${id}-increment`} class="increment" on:click={add}>+</button>
	<div class="children">
		<slot />
	</div>
</div>

<style>
	.counter {
		background: white;
	}
</style>