我在我的项目中使用 Angular 6.x.x
并具有以下 lodash
依赖项。
"dependencies": {
"@angular/common": "6.0.9",
"@angular/core": "6.0.9",
...
"@types/lodash": "^4.14.114",
...
},
以下两个导入都不适合我。
import _ from 'lodash';
import * as _ from 'lodash';
最佳答案
似乎以下导入工作正常。我的环境有问题。删除node_modules
目录并安装后,成功了。
import * as _ from 'lodash';
关于angular - 错误 TS1192 : Module @types/lodash/index has no default export,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51567592/