mirror of https://github.com/sveltejs/svelte
Merge pull request #1216 from sveltejs/gh-1213
prevent context variables being called component or statepull/1218/head
commit
a49c4faf4a
@ -0,0 +1,17 @@
|
||||
export default {
|
||||
html: `
|
||||
<ul>
|
||||
<li><input></li>
|
||||
<li>bar</li>
|
||||
<li>baz</li>
|
||||
</ul>
|
||||
`,
|
||||
|
||||
data: {
|
||||
components: [
|
||||
{ name: 'foo', edit: true },
|
||||
{ name: 'bar', edit: false },
|
||||
{ name: 'baz', edit: false }
|
||||
]
|
||||
}
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
<ul>
|
||||
{{#each components as component}}
|
||||
<li>
|
||||
{{#if component.edit}}
|
||||
<input ref:name bind:value=component.name />
|
||||
{{else}}
|
||||
{{component.name}}
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
Loading…
Reference in new issue