我正在使用新的dom-to-image库,当我试图在组件内部调用toPng方法时,我会遇到这个错误。
import domtoimage from 'dom-to-image-more';
export class MyComponent {
@ViewChild('leafletMap') leafletMap: ElementRef;
downloadMap = (): void => {
//error happens here
domtoimage.toPng(this.leafletMap.nativeElement).then((img: any) => {
console.log(img);
});
};
}
/* of course this is simplified */这个leafletMap存在于我的组件HTML中,当我记录它时,它包含一个HtmlNativeElement
发布于 2021-10-12 12:38:12
https://stackoverflow.com/questions/69539964
复制相似问题