How to dynamically bind canvas to vue data

novice, bosses, forgive me a lot

Vue
<btn @click="widthPP">

data() {
  width: 1
}

canvas

ctx.beginPath()
lineWidth = this.width

the value of width changes dynamically, and so does the lineWidth of canvas.
I"ve tried. I don"t seem to know much about canvas,. I"d like to ask you how to do this

.

perform the painting process once per click. If you need to reverse painting, you can clear redraw

.
Menu