mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 01:11:24 +01:00
add test for #643
This commit is contained in:
parent
e9516abffd
commit
78b3a1b079
22
test/runtime/samples/component-nested-deeper/Level1.html
Normal file
22
test/runtime/samples/component-nested-deeper/Level1.html
Normal file
@ -0,0 +1,22 @@
|
||||
<div class="level1">
|
||||
{{#each values as value}}
|
||||
<h4>level 1 #{{value}}</h4>
|
||||
<Level2 condition="{{value % 2}}">
|
||||
<Level3>
|
||||
<span>And more stuff goes in here</span>
|
||||
</Level3>
|
||||
</Level2>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import Level2 from './Level2.html';
|
||||
import Level3 from './Level3.html';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Level2,
|
||||
Level3
|
||||
}
|
||||
};
|
||||
</script>
|
8
test/runtime/samples/component-nested-deeper/Level2.html
Normal file
8
test/runtime/samples/component-nested-deeper/Level2.html
Normal file
@ -0,0 +1,8 @@
|
||||
<div class="level2" ref:wat>
|
||||
<h4>level 2</h4>
|
||||
{{#if condition}}
|
||||
<span>TRUE! {{yield}}</span>
|
||||
{{else}}
|
||||
<span>FALSE! {{yield}}</span>
|
||||
{{/if}}
|
||||
</div>
|
4
test/runtime/samples/component-nested-deeper/Level3.html
Normal file
4
test/runtime/samples/component-nested-deeper/Level3.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div class="level3" ref:thingy>
|
||||
<h4>level 3</h4>
|
||||
{{yield}}
|
||||
</div>
|
11
test/runtime/samples/component-nested-deeper/_config.js
Normal file
11
test/runtime/samples/component-nested-deeper/_config.js
Normal file
@ -0,0 +1,11 @@
|
||||
export default {
|
||||
solo: true,
|
||||
|
||||
data: {
|
||||
values: [1, 2, 3, 4]
|
||||
},
|
||||
|
||||
test(assert, component) {
|
||||
component.set({ values: [2, 3] });
|
||||
}
|
||||
};
|
11
test/runtime/samples/component-nested-deeper/main.html
Normal file
11
test/runtime/samples/component-nested-deeper/main.html
Normal file
@ -0,0 +1,11 @@
|
||||
<Level1 :values/>
|
||||
|
||||
<script>
|
||||
import Level1 from './Level1.html';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Level1
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user