1

我正在使用 domtoimage 库将 SVG 元素转换为 blob。我收到以下错误。如何排除故障是什么错误。

function download1(){
            alert('one');
            console.log('Inside Image Blob Creation Flow');
            const svg = document.getElementById("graphContainer").children[0];
            console.log(svg);
            var options = { "cacheBust":true }
            domtoimage.toBlob(svg,options).then(function (blob) {
                console.log('Blob Generated');
                console.log(blob);
                //window.saveAs(blob, 'my-node.png');
            }).catch(err =>  {
              console.log('Failed to Create Blob');
              console.log(err);
              alert(err);
            });
        };

在此处输入图像描述

4

0 回答 0