【发布时间】:2018-05-14 10:46:43
【问题描述】:
我想根据参数访问类属性,代码如下:
class Commander {
constructor() {}
create() {}
test() {}
undo() {}
redo() {}
execute(...args): void {
const command: string = args.slice(0);
const rest: any[] = args.slice(1);
this[command].apply(this, rest);
}
}
但我收到如下错误:
无法获取
this[command],因为Commander1 中缺少索引器属性。
更多信息请看flowtype try。
如果我做了一些愚蠢的事情,请告诉我!
谢谢!!
【问题讨论】:
标签: flowtype flow-typed