TypeScript中建立类

TypeScript中建立类javascript 须要向类中加入属性 而后传入构造方法constructor 再传入函数方法 class Person{ // 属性 name: string; age: number; // 构造方法 constructor(name:string, age:number) { this.name = nam
相关文章
相关标签/搜索