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

vue3.3 + ts, when v-for the computed array, the item type reference error #240

Open
RandyZ opened this issue Aug 23, 2023 · 0 comments
Open

Comments

@RandyZ
Copy link

RandyZ commented Aug 23, 2023

I have the vueGridItems like this...

import { computed } from 'vue-demi'
...
const vueGridItems = computed(() => {return [{i:1}, {i:2}] })

and template

<grid-item v-for="item in vueGridItems" v-bind="item" >
    <WmqGridItem
      ref="itemRefs"
      :uk="childrenWmqGridItem[item.i].uk" 
      :itemConfig="childrenWmqGridItem[item.i]" 
      :itemDataContext="childrenDataContext[item.i]"
      :itemProps="childrenWmqGridItem[item.i].props"
      :itemOptions="childrenWmqGridItem[item.i].options"
      :schemaData="childrenWmqGridItem[item.i].itemData"
    />
</grid-item>

item.i can not predict prop i, item type is

true | { i: number; }[] | ReactiveEffect<{ i: number; }[]>

true make editor recognize prop i fail, I have no idea where predict true

vue: 3.3
vue-demi: 0.14.5
editor: vscode and Vue Language Features (Volar) v1.8.8

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

No branches or pull requests

1 participant