class Animal{
name: string
constructor (name:string){
this.name=name
}
run(){
return `${this.name}`
}
}
const snake=new Animal("geyao")
class Dog extends Animal{
bark(){
return `${this.name}`
}
}
const dog=new Dog("geyao")
react18-学习笔记11-类class
最新推荐文章于 2024-04-07 17:52:24 发布