Giter VIP home page Giter VIP logo

Comments (5)

danielstgt avatar danielstgt commented on June 5, 2024

Could you show me the SVG and the exact error message? I will try to replicate your case.

I have one test case, with the following SVG:

<!-- File: svg_with_style_tag.svg -->

<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
  <style>
    circle {
      fill: gold;
      stroke: maroon;
      stroke-width: 2px;
    }
  </style>

  <circle cx="5" cy="5" r="4" />
</svg>

This is taken from the MDN web docs.

Including it also worked so far:

<svg-vue icon="svg_with_style_tag"></svg-vue>

from laravel-mix-svg-vue.

artfulrobot avatar artfulrobot commented on June 5, 2024

I tried the SVG in this zip (GH would not let me upload the svg directly).

parties.zip

from laravel-mix-svg-vue.

danielstgt avatar danielstgt commented on June 5, 2024

I've tried it with your parties.svg and it works without any errors.

What SVGO rules are you using and what is the exact error?

from laravel-mix-svg-vue.

danielstgt avatar danielstgt commented on June 5, 2024

To be more precise about the setup, this is how I implemented it.

// File: resources/js/app.js
import Vue from 'vue';
import SvgVue from 'svg-vue';

Vue.use(SvgVue);

let app = new Vue({
    el: '#app'
});
// File: webpack.mix.js
const mix = require('laravel-mix');
require('laravel-mix-svg-vue');

mix.js('resources/js/app.js', 'public/js')
    .svgVue();
<!-- In your Blade or Vue component, referring resources/svg/parties.svg -->
<svg-vue icon="parties"></svg-vue>

from laravel-mix-svg-vue.

artfulrobot avatar artfulrobot commented on June 5, 2024

I can no longer recreate this. I'm so sorry for wasting your time! I'd read something about the style thing being a problem, and so when I got a page full of errors about just that I think I must have assumed it was to do with this. I had tried a number of other vue/svg tricks beforehand, so probably they were to blame!

Thanks

from laravel-mix-svg-vue.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.