You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime-browser/custom-elements-samples/nested/Counter.svelte

20 lines
311 B

<svelte:options customElement="my-counter" />
<script>
import { getContext } from "svelte";
export let count = 0;
const context = getContext("context");
</script>
<slot />
<button on:click={() => (count += 1)}>count: {count}</button>
<p>Context {context}</p>
<style>
button {
color: red;
}
</style>