前言:
現(xiàn)在不努力,將來拿什么向曾經(jīng)拋棄你的人證明它有多瞎
--------------------------------正文---------------------------------
vue-resource
get
getData(){
this.$http.get('http://localhost:8081/getData').then(function(res){
console.log(res.body.a+res.body.b)
},function(){
alert('失敗');
});
}
jsonp
getData(){
this.$http.jsonp('https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su',{
params:{
wd:'a'
},
jsonp:'cb'
}).then(function(res){
this.getList=res.body.s;
},function(){
alert('失敗');
});
}
canvas
獲取canvas對象
獲取繪圖上下文 var gd = oC.getContext('2d');
重新開始路徑 gd.beginPath();
起始點 gd.moveTo(x,y);
目標點 gd.lineTo(x,y);
設(shè)置描邊顏色 gd.strokeStyle = 'color';
設(shè)置線寬 gd.lineWidth = width;
描邊 gd.stroke();
填充顏色 gd.fillStyle = 'color';
填充 gd.fill();
閉合路徑 gd.closePath();
清屏 gd.clearRect(x,y,w,h);
---------------------------------------------------------------------------------------
現(xiàn)有圖形 rect 矩形
a)
gd.rect(x,y,w,h);
gd.stroke()/fill();
b)
gd.strokeRect(x,y,w,h);
或
gd.fillRect(x,y,w,h);
幀頻
低幀頻
30 1000/30 33
高幀頻
16 1000/16 62
關(guān)于角度和弧度
Math.sin(α);
Math.cos(α);
360° = 2π
180° = 1π
π Math.PI
角度 ==> 弧度
n*Math.PI/180
弧度 ==> 角度
n*180/Math.PI