On the Internet, you can use the object element, but it reports 404, so the path is definitely correct.
Code:
Check this:https://stackoverflow.com/que...
Since the resource is svg, it is best to use the svg tag to reference it, so that you can resize the svg, set the fill color, and a series of svg features.
How to quote depends on which loader is used:
html:
<use xmlns:xlink="http://www.w3.org/1999/xlink" :xlink:href="require('../svg/icon-header.svg')"></use>
webpack:
{ test: /\.svg$/, loader: 'svg-sprite?' + JSON.stringify({ name: '[name]_[hash]', prefixize: true }) }
Loader address: https://github.com/kisenka/svg-sprite-loaderYou can view the API in detail.
If used as a picture, it can be used directly as a backgroundbackground-image: url('../../../static/icons/site.svg');
background-image: url('../../../static/icons/site.svg');
Check this:
https://stackoverflow.com/que...
Since the resource is svg, it is best to use the svg tag to reference it, so that you can resize the svg, set the fill color, and a series of svg features.
How to quote depends on which loader is used:
html:
webpack:
Loader address: https://github.com/kisenka/svg-sprite-loader
You can view the API in detail.
If used as a picture, it can be used directly as a background
background-image: url('../../../static/icons/site.svg');