版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_27868061/article/details/82918145
tsconfig.json
{
"compilerOptions": {
// 与 Vue 的浏览器支持保持一致
"target": "es5",
"lib": [
"es2015",
"dom"
],
"strict": true,
"strictPropertyInitialization": false,
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"strictFunctionTypes": false
}
}
1.lib:ts编译时使用的类型定义,其中es2015包含了一系列类型定义,dom包含了浏览器dom元素的类型定义
2.strictPropertyInitializtion:严格属性初始化:vue组件类的属性是否需要初始化