Comments (5)
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.
I tried the SVG in this zip (GH would not let me upload the svg directly).
from laravel-mix-svg-vue.
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.
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.
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)
- Error: You may need an appropriate loader to handle this file type HOT 1
- Prevent from stripping svg attributes HOT 2
- Update svgo version by deprecated utility HOT 4
- How to use removeAttrs
- Unique IDs HOT 2
- Incorrect icon displays with v-if, works correctly with v-show HOT 2
- Laravel Mix 6 + Vue 3 Support HOT 4
- Vue 3 without options API HOT 5
- How to use with Jetstream(Inertia) HOT 2
- Issues with Laravel Mix 6.0.20 and above? HOT 14
- Prevent from stripping viewBox HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-mix-svg-vue.