Open xgqfrms opened 4 years ago
interface IProps { firstName: string, lastName: string, age?: number; gender?: string, } // 泛型 class Human<T> { constructor(props) { // props } } // 类型“Human”不是泛型类型 class Person extends Human<IProps> { // [x: string]: any; firstName: any; lastName: any; constructor(props) { super(props); const { firstName, lastName, } = props; this.firstName = firstName; this.lastName = lastName; } }
https://www.cnblogs.com/xgqfrms/p/12899508.html
https://online.visualstudio.com/environment/5fbe727c-65e7-4401-8a37-50ecb2bc8d6f
vscode online