vuejs / composition-api

Composition API plugin for Vue 2

Home Page:https://composition-api.vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On the rigor of type checking in volar

hexf00 opened this issue · comments

A component declared through definecomponent has a defect in type verification.

Perhaps the definition of Data does not apply to all occasions?

I tried to delete the definition of unknown. I found that ComponentPropsOptions still need to accept the generics defined by unknown. Otherwise, the required definition of props will not be recognized, resulting in the attribute being considered optional.

I have explored here for the time being and found no other problems.

Snipaste_2022-05-26_00-59-22

I use https://github.com/johnsoncodehk/volar-starter vue2 branch.

I propose this issue because the Class API or Vue.extend performs better.

Snipaste_2022-05-26_01-07-37

vuejs/language-tools#1350 (comment)

This is @vue/composition-api behavior from

export type Data = { [key: string]: unknown }
.

vuejs/language-tools#1350 (comment)

Stale issue message

Experiencing the same issue :( this should be reopened.