mirror of https://github.com/sveltejs/svelte
prevent context variables being called component or state - fixes #1213
parent
c45b18a387
commit
fad5ccdf59
@ -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