vue-demi icon indicating copy to clipboard operation
vue-demi copied to clipboard

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

Open RandyZ opened this issue 1 year ago • 0 comments

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

RandyZ avatar Aug 23 '23 03:08 RandyZ