我正在尝试使用Bobril将图像添加到SVG中,但是这段代码不起作用:
{
tag: 'svg',
children: {
tag: 'image',
attrs: {
'xlink:href': 'https://raw.githubusercontent.com/Bobris/Bobril/master/logo.png',
x: 0,
y: 0,
width: 200,
height: 200
}
}
}
网页中添加了图像标签,但没有显示图像。当我在Chrome 的 DevTools 中复制该元素并再次粘贴时,图像就会显示出来。我做错了什么?