赞
踩
报错原因 加上了lang=ts
npm install typescript ts-loader --save-dev
configureWebpack: {
resolve: { extensions: [".ts", ".tsx", ".js", ".json"] },
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/\.vue$/],
}
}
]
}
}
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true,
"strictNullChecks": true,
"esModuleInterop": true,
"experimentalDecorators": true
}
}
vue-shim.d.ts
declare module "*.vue" {
import Vue from "vue";
export default Vue;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。