spham
12/4/2019 - 11:03 AM

screenshot

screenshot

screenshot() {
            /** 
            * ! sauvegarde screenshot
            */
            let vc = this
            return html2canvas(vc.showCaptureRef()).then(canvas => {
                document.getElementById('main')
                canvas.toBlob( blob => {
                    // * enregistrement
                    var fd = new FormData()
                    fd.append('file', blob, 'screenshot.png')
                    fd.append('id_contenu', this.last_id_contenu?this.last_id_contenu:this.contenu.ID_CONTENU)
                    axios.post("images", fd)
                }, 'image/png');
            }).catch((error) => {
                console.log("Erreur de téléchargement du rapport visuel", error)
            });  // fin html2canvas
        },