我正在将所有.js文件转换为.ts
我正在使用lodash at()
{
data:
{
test: 'test',
sample: 'sample'
}
}
sample.js:
var test = _.at(res[0], 'data.sample');
console.log(test);
输出:
'sample'
sample.ts:
let test = _.at(res[0], 'data.sample');
// error: Argument of type '"data.sample"' is not assignable to parameter of type 'Many<"constructor" | "toString" | "toLocaleString" | "valueOf" | "hasOwnProperty" | "isPrototypeO...'.
.ts文件中不能像.js文件中那样使用at()