标签:comment his xtend hello ret 原型 class ati code
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
static classMethod() {
console.log(‘fathor jt:hello‘);
}
}
class ColorPoint extends Point { //mix(Cons1,Cons2)
constructor(x, y, color) {
super(x, y);
this.color = color; // 正确
}
//原型方法
ptMethod(){
console.log(‘pt:hello‘);
}
static classMethod() {
//静态方法也是可以从super对象上调用
super.classMethod();
console.log(‘jt:hello‘);
}
get prop() {
return ‘getter‘;
}
set prop(value) {
console.log(‘setter: ‘+value);
}
}
标签:comment his xtend hello ret 原型 class ati code
原文地址:http://www.cnblogs.com/feixuan/p/6182830.html