Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect reference count for default slot #932

Closed
iliubinskii opened this issue Feb 3, 2022 · 9 comments
Closed

Incorrect reference count for default slot #932

iliubinskii opened this issue Feb 3, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@iliubinskii
Copy link

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 />
@sethidden
Copy link
Contributor

Related #934

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Mar 1, 2022
@peteringram0
Copy link

@johnsoncodehk v0.32.1 doesn't seem to fix this issue. Can this be re-opened?

@johnsoncodehk
Copy link
Member

@peteringram0 it's fixed for me, could you provide repro case?

@markbrockhoff
Copy link

markbrockhoff commented Mar 17, 2022

Hi @johnsoncodehk I'm facing the same issue using Volar v0.33.2. For reproduction I used the same example @ilyub posted initially:

image

image

When replacing the divs inside the parent with template tags with the v-slot attribute "default" the count changes to 1 like it should.
I agree with @peteringram0 that this issue doesn't seem to be fixed and should probably be re-opened.

@ElToroDM
Copy link

Hi, same here. Still the same bug, could anyone else confirm it?

@moracabanas
Copy link

Still an issue please reopen

image

@regurgitate
Copy link

I can confirm that bug is still present.
image

@so1ve so1ve reopened this Jul 7, 2023
@so1ve
Copy link
Member

so1ve commented Jul 7, 2023

@regurgitate Which version are you using?

@regurgitate
Copy link

@so1ve

@regurgitate Which version are you using?

v1.8.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants