mirror of https://github.com/sveltejs/svelte
parent
42843868f0
commit
4ec84dc725
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
export let content;
|
export let content;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{@html content}
|
{@html content}
|
@ -1,17 +1,17 @@
|
|||||||
<script>
|
<script>
|
||||||
import Component from './Component.svelte';
|
import Component from './Component.svelte';
|
||||||
|
|
||||||
let content1 = `<p>First line</p>`;
|
let content1 = `<p>First line</p>`;
|
||||||
let content2 = `<p>Another first line</p>`
|
let content2 = `<p>Another first line</p>`
|
||||||
|
|
||||||
let show = false;
|
let show = false;
|
||||||
$: content = show ? content1 : content2;
|
$: content = show ? content1 : content2;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button on:click={() => show = !show}>
|
<button on:click={() => show = !show}>
|
||||||
Switch
|
Switch
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<Component>
|
<Component>
|
||||||
{@html content}
|
{@html content}
|
||||||
</Component>
|
</Component>
|
Loading…
Reference in new issue