@4tw/vue-svg-icon

Vue component to display svg icons.

Usage no npm install needed!

<script type="module">
  import 4twVueSvgIcon from 'https://cdn.skypack.dev/@4tw/vue-svg-icon';
</script>

README

vue-svg-icon

Vue component to display svg icons.

Installation

yarn add @4tw/vue-svg-icon
yarn add --dev @4tw/vue-cli-plugin-svg-icon

Usage

Follow the usage on https://github.com/4teamwork/vue-cli-plugin-svg-icon.

Make sure you transpile the @4tw/vue-svg-icon dependency in your project. Because we use dynamic imports, it's not possible to precompile the library.

When you are using vue-cli simply add this option: https://cli.vuejs.org/config/#transpiledependencies.

// vue.config.js
module.exports = {
  // ...
  transpileDependencies: ['@4tw/vue-svg-icon'],
  // ...
}

Otherwise include the library in your webpack config so vue-loader and babel-loader compile the dependency.

<svg-icon>myicon</svg-icon>