当我在ts文件中定义好interface,在vue文件中引入的时候出现了问题。
文件:type.ts
export interface IOption {
label: string;
value: string | number;
}
vue文件:
import { IOption } from '@/config/type'; //找不到模块“@/config/type”或其相应的类型声明
tsconfig.json
{
"compilerOptions": {
"sourceMap": true,
"strict": true,
// "noImplicitAny": true,
"module": "esnext",
"target": "es6",
"moduleResolution": "Node",
"baseUrl": ".",
"paths": {
"/@/*": ["src/*"]
},
"lib": ["esnext", "dom"],
"esModuleInterop": true,
"plugins": [{ "name": "@vuedx/typescript-plugin-vue" }],
"suppressImplicitAnyIndexErrors": true,
"skipLibCheck": true
},
"include": ["**/*.ts", "**/*.d.ts", "**/*.vue"],
"exclude": ["node_modules"],
"vueCompilerOptions": {
"experimentalDisableTemplateSupport": true
}
}
评论中的
*
展示不出来