Skip to content

Can't get componentInstance property of vnode when using the v-slot directive on a <template>. #11464

Closed
@xiejay97

Description

@xiejay97

Version

2.6.11

Reproduction link

https://github.com/Xie-Jay/slot-issue

Steps to reproduce

I show issue by console.

What is expected?

All vnode can get componentInstance property.

What is actually happening?

ComponentInstance property is undefined when using the v-slot directive, but others not.

<slot-test>
  <component-test slot="default" name="slot1"></component-test>
</slot-test>
<slot-test>
  <template slot="default">
    <component-test name="slot2"></component-test>
  </template>
</slot-test>
<slot-test>
  <template v-slot:default>
    <component-test name="slot3"></component-test>
  </template>
</slot-test>

image


When I use v-slot to replace slot, I get this diffrence which really confuse me.

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