You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/App.vue:17:3 - error TS2322: Type 'Node[]' is not assignable to type '{ key: number; checked: boolean; }[]'. Type 'Node' is not assignable to type '{ key: number; checked: boolean; }'. Types of property 'checked' are incompatible. Type 'Ref<boolean>' is not assignable to type 'boolean'.17 nodes.value = array; ~~~~~~~~~~~src/App.vue:32:23 - error TS2345: Argument of type '{ key: number; checked: boolean; }' is not assignable to parameter of type 'Node'. Types of property 'checked' are incompatible. Type 'boolean' is not assignable to type 'Ref<boolean>'.32 @input="onInput(toRaw(node))" ~~~~~~~~~~~Found 2 errors.
This is ref type issue, please forward to upstream.
// test.tsimport{toRaw,onMounted,Ref,ref}from'vue'interfaceNode{key: numberchecked: Ref<boolean>}constnodes=ref<Node[]>([])onMounted(()=>{constarray: Node[]=newArray<Node>()for(constiof[0,1,2]){array.push({key: i,checked: ref(false)})}nodes.value=array// Type 'Node[]' is not assignable to type '{ key: number; checked: boolean; }[]'.})functiononInput(node: Node){console.log('onInput',node)}{// mock templatefor(constnodeofnodes.value){onInput(toRaw(node));// Argument of type '{ key: number; checked: boolean; }' is not assignable to parameter of type 'Node'.}}
Reproduction link
codesandbox.io
Steps to reproduce
Run
npm run build
in codesandboxWhat is expected?
No typescript errors
What is actually happening?
Got 2 typescript errors:
Additonal content (SFC where the errors happen)
The text was updated successfully, but these errors were encountered: