Skip to content

[2.6.2] New slot syntax doesn't allow nested templates #9426

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

Closed
LexSwed opened this issue Feb 5, 2019 · 2 comments
Closed

[2.6.2] New slot syntax doesn't allow nested templates #9426

LexSwed opened this issue Feb 5, 2019 · 2 comments

Comments

@LexSwed
Copy link

LexSwed commented Feb 5, 2019

Regarding the new named slots synta.
I have a component which dispatches async request and then uses received value in render. With named slots it was okay to have this kind of structure, so that I don't need to check every time whether the data is there. Is there a workaround for new slots?

Before:

<my-component>
    <template v-if="some !== null"> // this allows to have many nested components that use async data which is null initially
        <template slot="header"> // and here I use slot from my-component
            <span>{{ some.nested.values }}</span>
        </template>
        <template>
            <span> {{ some.nested.anotherValue }} </span>
        </template>
    </template>
</my-component>

Now:

<my-component>
    <template #header  v-if="some !== null"> // check is in computed but still not good
        <span>{{ some.nested.values }}</span>
    </template>
    <template  v-if="some !== null">
        <span> {{ some.nested.anotherValue }} </span>
    </template>
</my-component>
@vue-bot
Copy link
Contributor

vue-bot commented Feb 5, 2019

Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!

@vue-bot vue-bot closed this as completed Feb 5, 2019
@madmoizo
Copy link

madmoizo commented Feb 5, 2019

dup #9391

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

3 participants