kalimahapps / vue-options-to-composition

Online tool to convert vue2 options to vue3 composition API
https://kalimah-apps.com/vue-options-to-composition/
14 stars 7 forks source link

TypeScript support #7

Closed d9k closed 1 week ago

d9k commented 1 month ago

I know, probably it's hard to implement.

I had to use https://www.typescriptlang.org/play/ with TS config -> Target -> ESNext to strip types from "options" code and than return types to "composition" code by hand

Update: defineComponent() must be stripped to.

abdul-alhasany commented 1 month ago

It is hard to implement as you have stated. Generally speaking, vue2 and options API were not written using TypeScript so providing support for this feature might have limited use-case. If you have a sample code I can check if this is something feasible.