pull/613/head
Rich Harris 8 years ago
parent ce8dd647f0
commit e1001a7f34

@ -0,0 +1,5 @@
{{#if show}}
{{#each fields as field}}
<span>{{field}}</span>
{{/each}}
{{/if}}

@ -0,0 +1,36 @@
export default {
data: {
show: false,
fields: [1, 2]
},
html: `<div></div>`,
test ( assert, component, target ) {
component.set({
show: true,
fields: [1, 2, 3]
});
assert.htmlEqual( target.innerHTML, `
<div>
<span>1</span>
<span>2</span>
<span>3</span>
</div>
` );
component.set({
fields: [1, 2, 3, 4]
});
assert.htmlEqual( target.innerHTML, `
<div>
<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
</div>
` );
}
};

@ -0,0 +1,13 @@
<div>
<Nested :show :fields/>
</div>
<script>
import Nested from './Nested.html';
export default {
components: {
Nested
}
};
</script>
Loading…
Cancel
Save