【发布时间】:2018-01-27 05:45:11
【问题描述】:
如何将myOtherKey 属性设置为any?
打字稿错误..
Object literal's property 'children' implicitly has an 'any[]' type
对象初始化..
let myObject = {
myKey: 'someValue',
myOtherKey: []
};
【问题讨论】:
-
您可以允许隐式 any 或将数组转换为其预期类型或使用
new Array<T>()实例化它
标签: arrays typescript