1、将svg元素放入public下 可自定义一个文件夹用来放svg
如图:
2、将要加载的svg放入指定的div
<div ref="exportCanvas" id="removableDentureSvg"></div>
3、加载svg文件 import * as d3 from 'd3'
svgInit() {
let that = this
let iconFolder = '/svg/'
let containerDivId = '#removableDentureSvg'
let targetSrc = iconFolder + 'remote.svg'
// console.log(targetSrc, 'targetSrc')
d3.xml(targetSrc).then((data) => {