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.
35 lines
560 B
35 lines
560 B
6 years ago
|
<script>
|
||
6 years ago
|
import Foo from './Foo.svelte';
|
||
|
import Bar from './Bar.svelte';
|
||
|
import Baz from './Baz.svelte';
|
||
6 years ago
|
|
||
|
export let x;
|
||
|
export let tag = 'you\'re it';
|
||
|
export let foo;
|
||
|
export let bar;
|
||
|
export let things = ['a', 'b', 'c'];
|
||
|
</script>
|
||
|
|
||
7 years ago
|
<svelte:component this="{ x ? Foo : Bar }" x='{x}'>
|
||
7 years ago
|
<p>element</p>
|
||
|
|
||
7 years ago
|
{tag}
|
||
7 years ago
|
|
||
7 years ago
|
{#if foo}
|
||
7 years ago
|
<p>foo</p>
|
||
7 years ago
|
{:elseif bar}
|
||
7 years ago
|
<p>bar</p>
|
||
7 years ago
|
{:else}
|
||
7 years ago
|
<p>neither foo nor bar</p>
|
||
7 years ago
|
{/if}
|
||
7 years ago
|
|
||
|
text
|
||
|
|
||
7 years ago
|
{#each things as thing}
|
||
|
<span>{thing}</span>
|
||
|
{/each}
|
||
7 years ago
|
|
||
|
<Baz/>
|
||
|
|
||
|
<div slot='other'>what goes up must come down</div>
|
||
6 years ago
|
</svelte:component>
|