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

Empty attribute infer doesn't work with "boolean | undefined" since 0.25.25 #288

Closed
davidmatter opened this issue Jul 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@davidmatter
Copy link
Collaborator

The active attribute should be inferred correctly in the following code:

<Card>
    <template #content>
        <Steps>
            <StepsItem :number="1" title="Test" active></StepsItem>
            <StepsItem :number="2" title="Test"></StepsItem>
            <StepsItem :number="3" title="Test"></StepsItem>
        </Steps>
    </template>
</Card>

The component props definition:

export default defineComponent({
  name: 'StepsItem',
  props: {
    ...
    active: {
      type: Boolean,
      required: false,
    },
    ...
  },
})

Since v0.25.25, the following error is thrown:

../common/src/Styleguide.vue:195:47 - error TS2322: Type 'unknown' is not assignable to type 'boolean | undefined'.
  Type 'unknown' is not assignable to type 'true'.

195           <StepsItem :number="1" title="Test" active></StepsItem>
@johnsoncodehk johnsoncodehk added the bug Something isn't working label Jul 2, 2021
@johnsoncodehk
Copy link
Member

Fixed in f1288eb, thanks for the report!

@davidmatter
Copy link
Collaborator Author

Thanks for the fix!

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

2 participants