konva使用注意

151 阅读1分钟

1# Konvajs清除绘制线

const poly = new Konva.Line({ points: [10, 10, 100, 100], stroke: '#000', strokeWidth: 1, dash: [10, 8] })

stage.on('touchstart', function (e) { poly.points([20, 20, 200, 200]) layer.draw() layer.add(poly) }) 使用的是layer.draw()方法 image.png

2