从Vue 2.0升级到Vue 2.5后,Visual Studio Code抱怨没有找到模块。但是在使用Webpack进行编译时,会发现并编译模块!此外,模块可以从.vue文件中找到,而不是来自index.ts
index.ts
import App from './components/app.vue' // VS Code can't find module
but webpack still compiles it
app.vue
import Card from "./card.vue" // VS Code does find module
我的目录结构
src
-index.ts
-components
---app.vue
---card.vue
tsconfig.json
{
"compilerOptions": {
"outDir": "./dist/",
"module": "es2015",
"moduleResolution": "node",
"target": "es2015",
"lib": ["dom","es5","es2015.promise"]
},
"include": [
"./src/**/*"
]
}