Closed agustinbus closed 4 years ago
canvas is not an auto-scalable element, afak. You can try to detect your parent div's dimensions and set plugin's component property canv-width.
I tried it, but not effect using clientWidth. I have a data variable waveWidth, and a div element with waveWidth ref attribute. This is my code:
<av-line ref-link="player" :canv-width="waveWidth"/>
...
mounted() {
this.waveWidth = this.$refs.recorderCard.clientWidth
}
may be recorderCard.clientWidth is not ready in the moment and av-line is using default value. Try conditional render to see if it works:
<av-line v-if="waveWidth > 0" ref-link="player" :canv-width="waveWidth"/>
waveWidth must be observable, reactive parameter
It worked! Thanks a lot.
welcome
How can i fit canvas to parent div width?