摘要: // 1.类的属性和方法 class Dog { name: string = "旺财"; age: number = 2; shout() { console.log("汪汪汪") } } let dog = new Dog() // 2.类的构造函数(用于给类中的属性设定初始值,在创建类的实例时 阅读全文
posted @ 2024-05-23 22:45 布偶123 阅读(2) 评论(0) 推荐(0) 编辑