JS高级.

##canvas(画布)
    fillStyle 填充色
    strokeStyle 画笔颜色
    lineWidth  设值线条宽度
    rect  创建矩形
    moveTo  起始点
    closePath  自动闭合
    lineTo  添加一个新点,然后从开始点到这个点的线条
    arc  用于画圆形或部分圆
    scale  缩小或放大
    rotate  旋转
##类
class(ES6新增)
    例:class People{
          constructor(name,age){
              this.name=name;
                 this.age=age;
                               }
                    intro(){
                      console.log("我的名字叫:"+this.name);
                            }
                    }        
    子类要继承父类的话用super(),写在第一行

猜你喜欢

转载自www.cnblogs.com/lyczzc/p/9196855.html