Skip to content

Slots don't work on compiled SFC when imported to a client project #4083

Closed
@loadpixels

Description

@loadpixels

Version

3.1.4

Reproduction link

https://github.com/loadpixels/slots-example

Steps to reproduce

What is expected?

the slots are populated with the content you provide

What is actually happening?

nothing - the slot is never populated, also styles disappear - but i think that's probably a different problem


I've noted that when running on Vite - it works as expected in Development mode, but not when it's built. It doesn't work at all on a project generated by vue-cli

Slot data is still rendered if you use a pure .ts component with a render function - this only appears to affect Single File Components

I've run the same repo steps above using Vue 2 and confirmed everything works.

I can't be absolutely certain that it's not the fault of the above libraries - but vue-rollup-sfc produces working slots when used with Vue 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