I'm using TypeScript in Vue project.
But when I try to import vue file, I can't get .vue file since the 'cannot find module...' error.

What is weird is that intellisense only shows the directory right upper the .vue file.
Intellisense shows the directory well
But it doesn't show the .vue file inside it
I also have vue-shim.d.ts file in root directory.
You should install TypeScript Vue Plugin and Vue Language Features.
Try adding the following into index.d.ts in the project root, works for now.
declare module '*.vue' {
import Vue from 'vue'
export default Vue
}
or try to configure the path in tsconfig with
"paths": { "@/*":["./src/*"] }
or edit includes in tsconfig with
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With