svg 转图片
// 序列化 svg 文件(xml) 转成字符串
const svgString = new XMLSerializer()
.serializeToString(document.getElementById('svg'));
const img = new Image();
// svgString svg的xml文件字符串
const svg = new Blob([svgString], {type: "image/svg+xml;charset=utf-8"});
const domURL = self.URL || self.webkitURL || self;
const url = domURL.createObjectURL(svg);
img.src = url;
// append img to body
// ...