mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Merge pull request #13663 from j3rem1e/fixes-duplicate-preview
Svelte: Fix duplicate story preview
This commit is contained in:
commit
f89c14bb1b
@ -1,19 +1,7 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
export let component;
|
||||
export let props;
|
||||
let child;
|
||||
|
||||
const hash = `svelte mounter ${Math.floor(Math.random() * 100)}`;
|
||||
|
||||
onMount(() => {
|
||||
child = new component({
|
||||
target: document.getElementById(hash),
|
||||
props,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:options accessors={true} />
|
||||
<div id={hash} />
|
||||
<svelte:component this={component} {...props}/>
|
Loading…
x
Reference in New Issue
Block a user