Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not set block in nested component #4

Closed
Javey opened this issue Dec 28, 2017 · 1 comment
Closed

can not set block in nested component #4

Javey opened this issue Dec 28, 2017 · 1 comment

Comments

@Javey
Copy link
Owner

Javey commented Dec 28, 2017

Such as

// AnotherComponent
<div>{self.get('children)}</div>
// Component
<div>
    <AnotherComponent>
        <b:body>test</b:body>
    </AnotherComponent>
</div>
<Component>
    <b:body>component</b:body>
</Component>

if AnotherComponent have not a block named body, the content wich passd as block in Component will be ignored. Because the body block is a blocks property for AnotherComponent, not children.
Howerver you can do like this:

<div>
    <AnotherComponent>
        <div>
            <b:body>test</b:body>
        </div>
    </AnotherComponent>
</div>
@Javey
Copy link
Owner Author

Javey commented Aug 8, 2018

We can wrap block with template, so it will not render redundant element.

// Component
<div>
    <AnotherComponent>
        <template>
            <b:body>test</b:body>
        </template>
    </AnotherComponent>
</div>
<Component>
    <b:body>component</b:body>
</Component>

The result is:

<div>
    <div>component</div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant