TypeScript 中的泛型约束
摘要:
private games:BaseGame[]=[]; public getGame<T extends BaseGame>(index:number=0):T{ return <T>this.games[index]; } export class Test { constructor() { 阅读全文
posted @ 2020-05-19 15:27 kingBook 阅读(747) 评论(0) 推荐(0) 编辑