I am using 'dom to image library' instead of html2canvas to take screen shop of the page but i am stuck when I want to send convert image into server. I will appreciated your time. Here is what I've tried the whole weeks.
//template
<div id="my-node"><h1 style="background-color:blue;padding:4px;">Welcome to the page</h1></div>
<button v-on:click="saveImage"></button>
saveImage(){
var node = document.getElementById('my-node');
domtoimage.toPng(node)
.then(function (dataUrl) {
var image = new Image();
image.src = dataUrl;//From here I want to send this image to server
//document.body.appendChild(image);
})
//axio
new data = new form();
data.append('image')
axio.post('posts','data')
}