Convert an SVG file to Vue file.

Consider this is an svg file and the code looks like this.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 width="800.001px" height="800px" viewBox="0 0 800.001 800" style="enable-background:new 0 0 800.001 800;" xml:space="preserve"
	>
<g>
	<path d="M83....../>
</g>
</svg>

Use <template> tag and insert the content inside in it as shown below.


<template>
  <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 width="800.001px" height="800px" viewBox="0 0 800.001 800" style="enable-background:new 0 0 800.001 800;" xml:space="preserve"
	>
<g>
	<path d="M83....../>
</g>
</svg>

</template>

Then save the file with .vue extension

Leave a comment

Your email address will not be published. Required fields are marked *