Skip to content

new v-slot syntax not working with lazy loaded components inside slot template #9436

Closed
@plehnen

Description

@plehnen

Version

2.6.2

Reproduction link

https://codepen.io/anon/pen/ZwXRKJ

Steps to reproduce

Since 2.6.x when using the new v-slot syntax the following will not work:

<template #header>
  <my-component></my-component>
</template>

When the component is imported "lazy" like this:

components: {
  MyComponent: () => import('./MyComponent'),
},

This worked with the old slot syntax.

Now just nothing is shown. Only if the dom is refreshed (e.g. by some display toggle) the component is shown afterwards. But not on the first load.
Another workaround is not to use lazy imports and directly import the component.

What is expected?

v-slots should work with lazy loaded components like it did with the old slot syntax.

What is actually happening?

It is not shown (until the dom is reloaded)


Unfortunately I could not reproduce this async issue with codepen.

It took me quite a while to figure out it is the lazy import which causes my page is not working correctly anymore after updating to 2.6.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions