Skip to content

Scoped Slots doesn't work when count slotsΒ #12485

@sarkiroka

Description

@sarkiroka

Vue version

3.2.37

Link to minimal reproduction

https://codepen.io/sarkiroka/pen/mybyVNG?editors=1010

Steps to reproduce

When I call useSlots().default function (to get how many slot used), the scoped slots stops work.

working example: https://codepen.io/sarkiroka/pen/ZYzYOBR?editors=1010
don't working example: https://codepen.io/sarkiroka/pen/mybyVNG?editors=1010

My goal is get the count of the default slots.

const slots=useSlots();
const countOfSlots = slots.default().length;

What is expected?

Work properly

What is actually happening?

Don't work

System Info

No response

Any additional comments?

No response

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