Skip to content

Commit f8ca0d4

Browse files
committed
call outrocallback immediately for empty each block
1 parent 7c0986f commit f8ca0d4

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

src/shared/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function isPromise(value) {
1515
}
1616

1717
export function callAfter(fn, i) {
18+
if (i === 0) fn();
1819
return () => {
1920
if (!--i) fn();
2021
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>{thing}</p>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default {
2+
data: {
3+
visible: true,
4+
empty: []
5+
},
6+
7+
html: `
8+
<div>
9+
<p>text</p>
10+
</div>
11+
`,
12+
13+
nestedTransitions: true,
14+
15+
test(assert, component, target) {
16+
component.set({ visible: false });
17+
18+
assert.htmlEqual(target.innerHTML, ``);
19+
}
20+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{#if visible}
2+
<div>
3+
{#each empty as thing}
4+
<Thing {thing}/>
5+
{/each}
6+
7+
<p>text</p>
8+
</div>
9+
{/if}
10+
11+
<script>
12+
export default {
13+
components: {
14+
Thing: './Thing.html'
15+
}
16+
};
17+
</script>

0 commit comments

Comments
 (0)