报错如下:
代码可以编译运行,但是会有红线和报错。
在tsconfig.json
中:
{
// ...rest of config
"compilerOptions": {
// ...rest of compiler options
"baseUrl: ".",
"paths": {
"tslib" : ["path/to/node_modules/tslib/tslib.d.ts"]
}
}
}