We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0271a15 commit b077518Copy full SHA for b077518
examples/with-svelte/src/App.svelte
@@ -4,7 +4,7 @@
4
import { onMount } from 'svelte'
5
6
let fw: Fireworks
7
- let enabled = true
+ let mounted = true
8
let options: FireworksOptions = {
9
opacity: 0.5
10
}
@@ -26,15 +26,16 @@
26
27
<main>
28
<div class="buttons">
29
- <button on:click={() => (enabled = !enabled)}>
30
- {enabled ? 'Enabled' : 'Disabled'}
31
- </button>
32
- <button on:click={() => toggleFireworks()}>
33
- Toggle
+ <button on:click={() => (mounted = !mounted)}>
+ {mounted ? 'Mounted' : 'Unmounted'}
34
</button>
35
</div>
36
- {#if enabled}
37
- <Fireworks bind:this={fw} autostart={false} {options} class="fireworks" />
+ {#if mounted}
+ <Fireworks
+ bind:this={fw}
+ {options}
+ class="fireworks"
38
+ />
39
{/if}
40
</main>
41
0 commit comments