mirror of https://github.com/sveltejs/svelte
parent
83b19d5a91
commit
b4c66841af
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
let active = true;
|
||||
let foo = false;
|
||||
</script>
|
||||
|
||||
<div class:active class:bar={foo}>
|
||||
Hello world!
|
||||
</div>
|
||||
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
let active = true;
|
||||
let foo = false;
|
||||
</script>
|
||||
|
||||
<div class:active class:bar={foo}>
|
||||
Hello world!
|
||||
</div>
|
||||
@ -0,0 +1,9 @@
|
||||
<style>
|
||||
.foo {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.foo.bar {
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
<style>
|
||||
.foo {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.foo.bar {
|
||||
color: blue;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,5 @@
|
||||
<!-- inline -->
|
||||
|
||||
<!--
|
||||
multiline
|
||||
-->
|
||||
@ -0,0 +1,4 @@
|
||||
<!-- inline -->
|
||||
<!--
|
||||
multiline
|
||||
-->
|
||||
@ -0,0 +1,5 @@
|
||||
<style>
|
||||
.container .item { color: red; }
|
||||
nav > ul.menu { display: flex; }
|
||||
h2 + p.note { margin-top: 0; }
|
||||
</style>
|
||||
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
<style>
|
||||
.container .item {
|
||||
color: red;
|
||||
}
|
||||
|
||||
nav > ul.menu {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
h2 + p.note {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
import C from './C.svelte';
|
||||
</script>
|
||||
|
||||
<C foo="bar" />
|
||||
<C foo="bar">
|
||||
<span>Hello World</span>
|
||||
</C>
|
||||
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
import C from './C.svelte';
|
||||
</script>
|
||||
|
||||
<C foo="bar" />
|
||||
<C foo="bar"><span>Hello World</span></C>
|
||||
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
const boxes = [];
|
||||
</script>
|
||||
|
||||
{#each boxes as box}
|
||||
{@const area = box.width * box.height}
|
||||
{box.width} * {box.height} = {area}
|
||||
{/each}
|
||||
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
const boxes = [];
|
||||
</script>
|
||||
|
||||
{#each boxes as box}
|
||||
{@const const area = box.width * box.height;}
|
||||
{box.width} * {box.height} = {area}
|
||||
{/each}
|
||||
Loading…
Reference in new issue