Skip to content

defineProps cannot declared generic boolean type #9877

@alexzhang1030

Description

@alexzhang1030
Member

Activity

so1ve

so1ve commented on Dec 21, 2023

@so1ve
Member

The compiler doesn't resolve generics declared in <script setup generic="...">.

alexzhang1030

alexzhang1030 commented on Dec 21, 2023

@alexzhang1030
MemberAuthor

Should it be supported in the future, or it be designed thus?

so1ve

so1ve commented on Dec 21, 2023

@so1ve
Member
ascott18

ascott18 commented on Nov 23, 2024

@ascott18

Declaring the prop as TGeneric & boolean instead of just TGeneric seems to work for me, without breaking the generic-ness of the prop.

defineProps<{
  multiple?: TMultiple & boolean;
>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yyx990803@ascott18@alexzhang1030@so1ve

        Issue actions

          `defineProps` cannot declared generic boolean type · Issue #9877 · vuejs/core