【发布时间】:2017-06-29 22:56:01
【问题描述】:
我正在尝试使用 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 中复制元素并再次粘贴时,会显示图像。我究竟做错了什么?
【问题讨论】:
标签: javascript image typescript svg bobril