fix #1780 just start use parent instead parent.parent in IfBlock wrapper

pull/1804/head
Yury Zhuravlev 6 years ago committed by Conduitry
parent 1deb25e184
commit 079bd4e58a

@ -41,7 +41,7 @@ class IfBlockBranch extends Wrapper {
)
});
this.fragment = new FragmentWrapper(renderer, this.block, node.children, parent.parent, stripWhitespace, nextSibling);
this.fragment = new FragmentWrapper(renderer, this.block, node.children, parent, stripWhitespace, nextSibling);
this.isDynamic = this.block.dependencies.size > 0;
}

@ -0,0 +1,13 @@
export default {
data: {
dummy: false,
fruits: ['Apple', 'Banana', 'Tomato'],
},
html: '<div><div>Apple</div><div>Banana</div><div>Tomato</div></div>',
test ( assert, component, target ) {
component.set({ dummy: true });
assert.htmlEqual(target.innerHTML, '<div><div>Apple</div><div>Banana</div><div>Tomato</div></div>' );
}
};

@ -0,0 +1,7 @@
<div>
{#if fruits}
{#each fruits as fruit (fruit)}
<div>{fruit}</div>
{/each}
{/if}
</div>
Loading…
Cancel
Save