Я хочу посетить свойство класса в соответствии с параметрами в виде следующего кода:
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);
}
}
Но я получил ошибку, как показано ниже:
Cannot get
this[command]
because an indexer property is missing inCommander
1.
More info you can see the flowtype try.
Если я сделаю некоторые глупости, и, пожалуйста, дайте мне знать!
Спасибо!!