这是 plunkr:
<body>
<svg height=“200” width=“200”>
<g id="elem1" class="ng-scope ng-isolate-scope">
<g x="0" id="txt" y="0" height="333.3333333333333" width="255" fill-opacity="1" fill="#aa0000" stroke="#000000" stroke-opacity="1" frames="" mv="true">
<image x="0" y="0" height="333.3333333333333" width="255" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,URI"></image>
</g>
</g>
</svg>
它是两个嵌套元素内的 svg 图像。第二个有一堆参数的原因是因为它是从 Angular 指令编译后输出的。我在 jsfiddle 中的 html 是我在 google chrome 中收到的。该图像从 base-64 URI 读取。但无法加载。这可能是一件非常愚蠢的事情,因为我也是 SVG 新手。
最佳答案
我更新了你的 fiddle :http://jsfiddle.net/Rathunter/6L7utsoe/1/
你在 SVG 上设置了一些奇怪的引号
<svg width="200" height="200"> </svg>
这似乎打破了你的例子。
希望这有帮助!
关于svg - 为什么 svg 中的该图像不显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31415119/