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

Strange typing issue trying to create a wrapper component #1433

Closed
Shayan-To opened this issue Jun 9, 2022 · 1 comment
Closed

Strange typing issue trying to create a wrapper component #1433

Shayan-To opened this issue Jun 9, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@Shayan-To
Copy link

I'm trying to create a wrapper component, so that everything is passed to the child element. This code is giving me errors:

<template>
    <component is="some-component">
        <template v-for="slot in Object.keys($slots)" #[slot]="slotProps">
            <slot :name="slot" v-bind="{ ...slotProps }" />
        </template>
    </component>
</template>

<script setup lang="ts"></script>

The error is that it does not recognize slotProps, and says Property 'slotProps' does not exist on type .....

When I don't use <component is="...">, the problem goes away. From what I'm seeing from the syntax coloring, the identifier slot in #[slot]="slotProps" is red when the error occurs, but is black when it doesn't. So there might be a problem with typing of component component, that I couldn't figure out how to fix.

Version: 0.37.3
Repro link: https://gist.github.com/Shayan-To/d7046b159232b09d7eafd1e88cea3aaa

@johnsoncodehk
Copy link
Member

Duplicate of #1425

@johnsoncodehk johnsoncodehk marked this as a duplicate of #1425 Jun 12, 2022
@johnsoncodehk johnsoncodehk added the duplicate This issue or pull request already exists label Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants