first look at the picture
:
- canvas
1490px
-
740px
2.
canvas
3.
- vue ,
canvas
... - (4)
4.
- ,
canvas
-
vue-cli
, ,canvas
- add
set the browser to non-full screen state, and then change the size of the browser.canvas
elements will also return to the container
although there is a problem with the above, the first picture shows that the browser has obtained 740px
adding a delay can solve the problem, but it doesn"t feel good. I"m looking forward to a better solution
.export const setCanvasWidth = that => {
setTimeout(() => {
const elWidthValue = that.$refs.el.offsetWidth;
that.canvasWidth = `${elWidthValue}`; // props need String
}, 300);
};