mirror of https://github.com/sveltejs/svelte
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.
23 lines
349 B
23 lines
349 B
4 years ago
|
<svelte:options tag="my-app"/>
|
||
|
|
||
|
<script>
|
||
|
import { onMount, onDestroy } from 'svelte';
|
||
|
|
||
|
let el;
|
||
|
let parentEl;
|
||
|
|
||
|
onMount(() => {
|
||
|
parentEl = el.parentNode.host.parentElement;
|
||
|
|
||
|
return () => {
|
||
|
parentEl.dataset.onMountDestroyed = true;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
onDestroy(() => {
|
||
|
parentEl.dataset.destroyed = true;
|
||
|
})
|
||
|
</script>
|
||
|
|
||
|
<div bind:this={el}></div>
|