問題如圖:
TS2538: Type 'undefined' cannot be used as an index type
image.png
image.png
解決辦法:聲明接口的最后一個(gè)成員需要加上
[propName: string]: Function;
技術(shù)分享圖片
問題如圖:
TS2538: Type 'undefined' cannot be used as an index type
[propName: string]: Function;