v-if not always recognized
tamsler-valtech opened this issue · comments
Thomas Amsler commented
Describe the bug
I have a rather simple template to render dynamic components in a grid:
<template>
<div v-if="item" class=gridItem">
<component :is="item.component" v-bind="item.props" />
</div>
</template>
This works fine in runtime, but VueDX complains about it:
- On
<component
: Type '{ prop1: PropType1; prop2?: PropType2 | undefined; }' has no properties in common with type 'ReservedProps'.VueDX/TS(2559) -> I use the exact same type for item in a different component, where VueDX does not complain, so I assume it is in combination with the next error - On
item
in:is="item.component"
: Object is possibly 'undefined'.VueDX/TS(2532) -> I check for item on the wrapping div
Expected behavior
These should not be marked as an error.
Additional context
I am using Nuxt 2.15.3 with the nuxt-composition-api 0.24.4 and TypeScript