A tool for transforming svg to js which can be import in vue component
npm run svg2js
<template>
<div id="example-app" class="example-wrapper">
<icon name="doc"></icon>
<icon name="jpg"></icon>
</div>
</template>
<script>
import './icons/doc.js'
import './icons/jpg.js'
import Icon from './Icon.vue'
export default {
components: {
icon: Icon
}
}
</script>
The styles without inline cann't be transformed into javascript file. You can use 'classIntoAttr.html' to move the styles into tag's attributes.
- Merge transforming class into svg attributes