小程序插件:支持
增加一个新点,然后创建一条从上次指定点到目标点的线。用 stroke 方法来画线条
stroke
目标位置的 x 坐标
目标位置的 y 坐标
const ctx = wx.createCanvasContext('myCanvas') ctx.moveTo(10, 10) ctx.rect(10, 10, 100, 50) ctx.lineTo(110, 60) ctx.stroke() ctx.draw()