I found out that when using a template ref for a canvas while naming it canvas, that the vue2 compiler doesn't work. It does work with vue3 compiler, and when renaming the ref to for example cv.
I'm not 100% certain that its only with canvas refs or also with other elements.
I also noticed that during compilation the canvas variable was renamed to canvas2, but the original canvas is still referenced in the code, which is then undefined.
Expected outcome
It should just work the same as in vue3 when giving the name canvas it shouldn't be an issue?
Description
I found out that when using a template ref for a canvas while naming it
canvas
, that the vue2 compiler doesn't work. It does work with vue3 compiler, and when renaming the ref to for examplecv
.I'm not 100% certain that its only with canvas refs or also with other elements.
I also noticed that during compilation the
canvas
variable was renamed tocanvas2
, but the originalcanvas
is still referenced in the code, which is then undefined.Expected outcome
It should just work the same as in vue3 when giving the name canvas it shouldn't be an issue?
Reproduction
https://github.com/jclaessens97/template-ref-repro
go to
vue3-lib
->npm run dev
-> works go tovue2-lib
->npm run dev
-> works go tovue2-lib
-> uncomment canvas & comment cv -> crashes