- ios17自定义icon不显示
[图片][图片] 1图为安卓等正常情况 2图为异常 多处图标不显示 在安卓及其他端正常
2023-11-27 - canvas画不了东西了 有大佬给看看么? 昨天发现的 之前一直好好的
"Component "xxx" does not have a method "true" to handle event "touchmove"." 提示这个东西 下面是代码 <canvas @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" :disable-scroll="true" canvas-id="xkx" id="xkx" style="width: 100%; height: 800rpx;"></canvas> methods: { createCanvas() { console.log("创建画") //创建绘图对象 this.ctx = uni.createCanvasContext('xkx', this); //设置画笔样式 this.ctx.lineWidth = 4; this.ctx.lineCap = 'round'; this.ctx.lineJoin = 'round'; }, touchstart() { console.log("开始") console.log(e.changedTouches[0].x) console.log(e.changedTouches[0].y) let startX = e.changedTouches[0].x; let startY = e.changedTouches[0].y; let startPoint = { X: startX, Y: startY }; this.points.push(startPoint); //每次触摸开始,开启新的路径 this.ctx.beginPath(); }, touchmove(e) { console.log("开始移动") console.log(e.changedTouches[0].x) console.log(e.changedTouches[0].y) let moveX = e.changedTouches[0].x; let moveY = e.changedTouches[0].y; let movePoint = { X: moveX, Y: moveY }; this.points.push(movePoint); //存点 let len = this.points.length; if (len >= 2) { this.draw(); //绘制路径 } }, true(e) { console.log("开始移动") console.log(e.changedTouches[0].x) console.log(e.changedTouches[0].y) let moveX = e.changedTouches[0].x; let moveY = e.changedTouches[0].y; let movePoint = { X: moveX, Y: moveY }; this.points.push(movePoint); //存点 let len = this.points.length; if (len >= 2) { this.draw(); //绘制路径 } }, touchend() { this.points = []; }, draw() { console.log("开始画") console.log("开始画") let point1 = this.points[0]; let point2 = this.points[1]; this.points.shift(); this.ctx.moveTo(point1.X, point1.Y); this.ctx.lineTo(point2.X, point2.Y); this.ctx.stroke(); this.ctx.draw(true); }, clear() { let that = this; uni.getSystemInfo({ success: function(res) { let canvasw = res.windowWidth; let canvash = res.windowHeight; that.ctx.clearRect(0, 0, canvasw, canvash); that.ctx.draw(true); } }); }, close(){ this.$refs.caogao.close(); this.caogaoflag = false; } }
2023-04-19