Skip to content

Commit

Permalink
unique name for select_block_type in IfBlock#buildCompoundWithOutros
Browse files Browse the repository at this point in the history
Fixes #1580
  • Loading branch information
Conduitry committed Jul 8, 2018
1 parent 909536d commit a2368cd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile/nodes/IfBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default class IfBlock extends Node {
dynamic,
{ name, anchor, hasElse }
) {
const select_block_type = block.getUniqueName(`select_block_type`);
const select_block_type = this.compiler.getUniqueName(`select_block_type`);
const current_block_type_index = block.getUniqueName(`current_block_type_index`);
const previous_block_index = block.getUniqueName(`previous_block_index`);
const if_block_creators = block.getUniqueName(`if_block_creators`);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
nestedTransitions: true,
html: `
<div></div>
<div></div>
`,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{#if foo}
<Component/>
{:else}
<Component/>
{/if}

{#if foo}
<div></div>
{:else}
<div></div>
{/if}

<script>
export default {
components: {
Component: './Component.html',
},
data: () => ({ foo: true }),
}
</script>

0 comments on commit a2368cd

Please sign in to comment.