johnsoncodehk / vue-tsc

vue-tsc --noEmit && vite build
https://www.npmjs.com/package/vue-tsc
MIT License
241 stars 6 forks source link

TS2322 when using multiple checkboxes, bound to the same array #57

Closed antony-k1208 closed 3 years ago

antony-k1208 commented 3 years ago

Hey,

when using multiple checkboxes, which are bound to the same array TS2322 arises. See the following image:

image

Of course its valid vue syntax to do so, which can be seen here: https://v3.vuejs.org/guide/forms.html#checkbox

Thank you very much for all your effort!

johnsoncodehk commented 3 years ago

Thanks for the report, and this is upstream issue.

checkbox's v-model prop is checked(https://v3.vuejs.org/guide/forms.html#basic-usage), and checked type is Booleanish = boolean | 'true' | 'false'(https://github.com/vuejs/vue-next/blob/7ffa225aa334f0fd7da6ba30bee9109de3597643/packages/runtime-dom/types/jsx.d.ts#L458), so number[] can't assign to checked in expected.

Please report this problem to vue repo.