摘要:
访问类型有 private, protected, public class Person { name: string; public sayHi() { console.log(this.name); // 类内调用 } } class Teacher extends Person{ publi 阅读全文
摘要:
class Person{ } 这就是 ts 里面最基础的类 class Person { name = 'zina'; getName() { return this.name } } // 有了类后创建一个实例 const person = new Person(); console.log(p 阅读全文