onReady() { constctx = uni.createCanvasContext("sign"); this.ctx = ctx; this.ctx.setStrokeStyle(this.lineColor); this.ctx.setLineWidth(this.lineWidth); // 获取canvas的宽高 constquery = uni.createSelectorQuery().in(this); query.select("#sign").boundingClientRect(); query.exec((res) ...
[], //路径点集合 showCanvas:false,// }; }, methods: { close:function(){ this.showCanvas = false; this.clear(); }, initCanvas() { this.showCanvas = true; this.oc = uni.createCanvasContext('canvasid'); console.log(this.oc); //设置画笔样式 this.oc.lineWidth = 4; this.oc....