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

$scopedSlots is not mirrored correctly in context.slots #911

Closed
tomasz-pucka opened this issue Mar 3, 2022 · 3 comments
Closed

$scopedSlots is not mirrored correctly in context.slots #911

tomasz-pucka opened this issue Mar 3, 2022 · 3 comments

Comments

@tomasz-pucka
Copy link

tomasz-pucka commented Mar 3, 2022

Version

1.4.9

Reproduction link

Vue 2
Comparison with Vue 3
If there are some issues with running the preview, try to refresh it using the refresh button in the console.

Steps to reproduce

Toggle the checkbox in the preview and observe the conditionally rendered content and slot objects values in the console. Try to change the initial showSlots value in the App component to false and observe the difference.

What is expected?

The context.slots property should be updated when slots are rendered conditionally and contain up-to-date value in the updated hook. Behaviour should be identical to the vue 3 example.

What is actually happening?

The value of context.slots doesn't seem to be updated after component initialization.

@tomasz-pucka tomasz-pucka changed the title $scopedSlots are not mirrored correctly in context.slots $scopedSlots is not mirrored correctly in context.slots Mar 3, 2022
@github-actions
Copy link

github-actions bot commented May 2, 2022

Stale issue message

@tomasz-pucka
Copy link
Author

Any updates on this issue?

@skytt
Copy link

skytt commented Jun 13, 2022

The same problem.... got empty context.slots object when the slot was updated after mounted lifecycle. Using getCurrentInstance().vnode.componentInstance.$scopedSlots.default?.({}) can get the current slots content, but context.slots cannot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants