没有合适的资源?快使用搜索试试~ 我知道了~
export default { data() { return { canvas:'', percent:'', ctx:'', circleX:'', circleY:'', radius:'', cradius:'', lineWidth:'', fontSize:'', color:'', process:'', circleLoading:null, }; }, mounted() { this.toCan
资源推荐
资源详情
资源评论
半圆形进度条半圆形进度条(vue)
export default {
data() {
return {
canvas:'',
percent:'',
ctx:'',
circleX:'',
circleY:'',
radius:'',
cradius:'',
lineWidth:'',
fontSize:'',
color:'',
process:'',
circleLoading:null,
};
},
mounted() {
this.toCanvas("canvas", "#ffbf00", 80);
},
methods: {
//两端圆点
smallcircle1(cx, cy, r) {
this.ctx.beginPath();
// this.ctx.moveTo(cx + r, cy);
this.ctx.lineWidth = 1;
this.ctx.fillStyle = "#06a8f3";
this.ctx.arc(cx, cy, r, 0, Math.PI * 2);
this.ctx.fill();
},
smallcircle2(cx, cy, r) {
this.ctx.beginPath();
//ctx.moveTo(cx + r, cy);
this.ctx.lineWidth = 1;
this.ctx.fillStyle = "#fff";
this.ctx.arc(cx, cy, r, 0, Math.PI * 2);
this.ctx.fill();
},
//画圆
circle(cx, cy, r) {
this.ctx.beginPath();
//ctx.moveTo(cx + r, cy);
this.ctx.lineWidth = this.lineWidth;
this.ctx.strokeStyle = "#eee";
this.ctx.arc(cx, cy, r, (Math.PI * 2) / 3, (Math.PI * 1) / 3);
this.ctx.stroke();
},
//画弧线
sector(cx, cy, r, startAngle, endAngle, anti) {
this.ctx.beginPath();
//ctx.moveTo(cx, cy + r); // 从圆形底部开始画
this.ctx.lineWidth = this.lineWidth;
// 进度条颜色
this.ctx.strokeStyle = this.color;
//圆弧两端的样式
this.ctx.lineCap = "round";
//圆弧
this.ctx.arc(cx,cy,r,(Math.PI * 2) / 3,(Math.PI * 2) / 3 + (endAngle / 100) * ((Math.PI * 5) / 3),false);
this.ctx.stroke();
},
//刷新
loading(progress) {
if (this.process >= this.percent) {
clearInterval(this.circleLoading);
}
weixin_38704701
- 粉丝: 8
- 资源: 982
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页