Skip to content

Commit a2368cd

Browse files
committed
unique name for select_block_type in IfBlock#buildCompoundWithOutros
Fixes #1580
1 parent 909536d commit a2368cd

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

src/compile/nodes/IfBlock.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export default class IfBlock extends Node {
250250
dynamic,
251251
{ name, anchor, hasElse }
252252
) {
253-
const select_block_type = block.getUniqueName(`select_block_type`);
253+
const select_block_type = this.compiler.getUniqueName(`select_block_type`);
254254
const current_block_type_index = block.getUniqueName(`current_block_type_index`);
255255
const previous_block_index = block.getUniqueName(`previous_block_index`);
256256
const if_block_creators = block.getUniqueName(`if_block_creators`);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div></div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
nestedTransitions: true,
3+
html: `
4+
<div></div>
5+
<div></div>
6+
`,
7+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{#if foo}
2+
<Component/>
3+
{:else}
4+
<Component/>
5+
{/if}
6+
7+
{#if foo}
8+
<div></div>
9+
{:else}
10+
<div></div>
11+
{/if}
12+
13+
<script>
14+
export default {
15+
components: {
16+
Component: './Component.html',
17+
},
18+
data: () => ({ foo: true }),
19+
}
20+
</script>

0 commit comments

Comments
 (0)