class
- class 关键字, 构造器和类分开了
- class 里面直接添加方法
- 继承:
class User{
constructor(name,pass){
this.name = name;
this.pass = pass
}
showName(){
alert(this.name)
}
showPass(){
alert(this.pass)
}
}
//Students 继承User,
class Students extends User{
constructor(name,pass,blabl){
super(name,pass);
}
}
React
- 组件化--class
- 强依赖JSX
JSX==bable==browser.js
<script type="text/babel">
网友评论