mirror of https://github.com/sveltejs/svelte
parent
f136f951b3
commit
7569cf60c0
@ -0,0 +1,10 @@
|
||||
export default {
|
||||
data: {
|
||||
items: [
|
||||
{ foo: true, bar: false },
|
||||
{ foo: false, bar: true },
|
||||
{ foo: true, bar: true }
|
||||
]
|
||||
},
|
||||
html: `<div class="foo ">1</div><div class=" bar">2</div><div class="foo bar">3</div><!--#each items-->`
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
{{#each items as item, i}}
|
||||
<div class='{{item.foo ? "foo" : ""}} {{item.bar ? "bar" : ""}}'>{{i + 1}}</div>
|
||||
{{/each}}
|
Loading…
Reference in new issue