es6继承

来源:互联网 发布:远走高飞网络歌曲 编辑:程序博客网 时间:2024/05/18 04:01

在es6里 一个子元素如何继承一个父元素的方法

class Father{    run(){        console.log('runFather')    }}class Child extends Father{}var c1 = new Child();c1.run()//runFather一个extends搞定
原创粉丝点击