Typescript 使用Immutable.Map时出错
获取错误 类型为“{name:string;插曲:number;}”的参数不能分配给类型为“Iterable”的参数 下面是一段代码Typescript 使用Immutable.Map时出错,typescript,angular5,immutable.js,Typescript,Angular5,Immutable.js,获取错误 类型为“{name:string;插曲:number;}”的参数不能分配给类型为“Iterable”的参数 下面是一段代码 let movie = Immutable.Map<string, any>({ name: "Star Wars", episode: 8 }); let movie=Immutable.Map({ 名称:“星球大战”, 第8集 }); 我不知道为什么会出现上述错误以及如何修复它。[string,any]是一
let movie = Immutable.Map<string, any>({
name: "Star Wars",
episode: 8
});
let movie=Immutable.Map({
名称:“星球大战”,
第8集
});
我不知道为什么会出现上述错误以及如何修复它。[string,any]是一个数组而不是一个对象。尝试:
let movie = Immutable.Map(["Star Wars", 7]);
[string,any]是数组而不是对象。尝试:
let movie = Immutable.Map(["Star Wars", 7]);
不工作。显示错误:类型为“(string | number)[]”的参数不能分配给类型为“{[key:string]:{};}的参数,让movie=Immutable.Map({[“星球大战]:{插曲:7}});不工作。显示错误:类型为“(string | number)[]”的参数不能分配给类型为“{[key:string]:{};}的参数,让movie=Immutable.Map({[“星球大战]:{插曲:7}});