Open mesqueeb opened 4 years ago
@egoist
For Vue 2, a framework like Quasar exposed types like these when importing components:
export interface QInput extends Vue {
/**
* Used to specify the name of the control; Useful if dealing with forms; If not specified, it takes the value of 'for' prop, if it exists
*/
name? : string
/**
* Custom mask or one of the predefined mask names
*/
mask? : string
// etc...
I don't think it might be worth trying to create this feature for Vue 2. I'd say in favour of spending time more wisely only focus on Vue 3.
It might actually be a good idea to just publish <script lang="ts">
as is now since transpiling TypeScript is fast (Vite).
@egoist is it possible to use lang="ts"
even if your components are used in non-ts Vue 3 projects?
For anyone coming here, if you're looking to add IntelliSense to your Vue components:
Then you can use the package vue-intellisense for that:
is it possible to use lang="ts" even if your components are used in non-ts Vue 3 projects?
Yes for Vite.
I also recommend this vscode extension for vue 3 projects https://github.com/johnsoncodehk/volar
@egoist thanks for telling me this tool! Is it to be used alongside vetur or meant to replace vetur?
It replaces Vetur, in fact there would be conflicts if you have both of them enabled.
So I made one here: https://github.com/egoist/vue-dts-gen
Hey Egoist, Thanks for this awesome library and the suggestion.
If components could be typed so there's better auto completion in VSCode that's would be really awesome !!
Do you have any ideas how to achieve this ?