Skip to content

Performance: compile default slots to functions #9756

Open
@KaelWD

Description

@KaelWD

What problem does this feature solve?

The original v-slot implementation was not available in this.$slots, but that was added in 2.6.4. Scoped slots reduce unnecessary re-renders with nested slots, so this change would hopefully provide a performance improvement for component libraries.

What does the proposed API look like?

<foo>default slot</foo>

should output

_c('foo',{scopedSlots:_u([{key:"default",fn:function(){return [_v("default slot")]},proxy:true}])})

Equivalent to <foo v-slot>default slot</foo>


Note #9580 could be a problem if lots of people rely on that behaviour.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions