Skip to content

Incorrect reference count for default slot #932

@iliubinskii

Description

@iliubinskii

Volar shows "1 reference" (correct) in this scenario:

Child.vue:
<template>
  <div>
    <slot></slot>
  </div>
<template>

Parent.vue:
<Child>
  <template #default>
    Some code
  </template>
</Child>

But it shows "0 references" (incorrect) in this scenario:

Child.vue:
<template>
  <div>
    <slot></slot>
  </div>
<template>

Parent.vue:
<Child>
  Some code
</Child>

image

This is not right.
Default slot is used once in both of the above scenarios.

Here is the only scenario when default slot is not used:

Child.vue:
<template>
  <div>
    <slot></slot>
  </div>
<template>

Parent.vue:
<Child />

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions