svg to vue component - Search
About 378,000 results
Open links in new tab
    Kizdar net | Kizdar net | Кыздар Нет
    Upvotes55answered Aug 4, 2017 at 17:33

    Based on the information you provided, what you can do is:

    • Install vue-svg-loader

    npm install --save-dev vue-svg-loader

    • Configure webpack:

    module: {
    rules: [
    {
    test: /\.svg$/,
    loader: 'vue-svg-loader', // `vue-svg` for webpack 1.x
    },
    ],
    },
    • Import the svg and use it as a regular component:

    <template>
    <nav id="menu">
    <a href="...">
    <SomeIcon class="icon" />
    Some page
    </a>
    </nav>
    </template>

    <script>
    import SomeIcon from './assets/some-icon.svg';

    export default {
    name: 'menu',
    components: {
    SomeIcon,
    },
    };
    </script>

    Reference: https://github.com/visualfanatic/vue-svg-lo...

    Content Under CC-BY-SA license
    Was this helpful?
     
  1. How can I import a svg file to a Vue component? - Stack Overflow

     
  2. Using SVG and Vue.js: A complete guide - LogRocket Blog

  3. svg-to-vue-component - npm

  4. javascript - How do I import an svg in Vue 3? - Stack Overflow

  5. vue-svg-loader

  6. Import SVG to Vite + Vue projects | by Oleksandr …

    WEBOct 10, 2023 · Guide for better importing SVGs into Vite + Vue app - by URL, as raw HTML, or as Vue component.

  7. svg-to-vue-component - GitHub

  8. GitHub - egoist/svg-to-vue-component: Transform SVG files into …

  9. GitHub - gonghongchen/vue-svg-component: Transform svg to …

  10. How to import an SVG file to a Vue.js component? - The Web Dev

  11. vite-svg-loader - npm

  12. Using SVGs in Vuejs made simple - DEV Community

  13. Managing SVG images in Vue.js applications - codeburst

  14. Dealing with SVG icons in Vue + Vite - DEV Community

  15. SVG to Vue.js component - Figma

  16. Use SVG files as Vue components with Vite - GitHub

  17. svg-to-vue-component examples - CodeSandbox

  18. vue.js - How to use svg component in vuejs - Stack Overflow

  19. Some results have been removed