Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VueJS: first impression and how to work with SVGs #57

Open
gazpachu opened this issue Jun 8, 2022 · 7 comments
Open

VueJS: first impression and how to work with SVGs #57

gazpachu opened this issue Jun 8, 2022 · 7 comments
Labels
blog Blog posts work

Comments

@gazpachu
Copy link
Owner

gazpachu commented Jun 8, 2022

Written on 13/01/2017

URL: https://www.joanmira.com/blog/vuejs-first-impression-and-how-to-work-with-svgs/

@gazpachu
Copy link
Owner Author

gazpachu commented Jun 8, 2022

Comment written by Andrew on 01/13/2017

Great write-up :) I ended up using the same approach in my project as well

@gazpachu
Copy link
Owner Author

gazpachu commented Jun 8, 2022

Comment written by gazpachu on 01/13/2017

@andrew Thanks for letting me know!

@gazpachu
Copy link
Owner Author

gazpachu commented Jun 8, 2022

Comment written by JSalandy on 01/14/2017

Thanks for sharing this, great read! Very informative, clear and concise, I'll be trying this approach on my next project.

@gazpachu
Copy link
Owner Author

gazpachu commented Jun 8, 2022

Comment written by gazpachu on 01/14/2017

Cheers mate :)

@gazpachu
Copy link
Owner Author

gazpachu commented Jun 8, 2022

Comment written by Mali Naeemi on 03/18/2017

It's no longer allowed to omit the '-loader' suffix when using loaders. You need to specify 'svg-sprite-loader' instead of 'svg-sprite'.
Being a noob, I was scratching my head whole day to solve the error that I was getting and it was this small issue..
Please change your loader snippet to:

loader: 'svg-sprite-loader?' + JSON.stringify({
name: '[name]_[hash]',
prefixize: true
})

@gazpachu
Copy link
Owner Author

gazpachu commented Jun 8, 2022

Comment written by Gustavo Soeiro Senise on 08/02/2017

Hello Joan,

I followed your steps but could not get this to work. The app runs but I get error trying to load the svgs. I assume that this is a vue-cli version problem. My package.json is like this:

{
"name": "svgtests",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
},
"dependencies": {
"svg-sprite-loader": "^3.0.10",
"vue": "^2.3.3",
"vue-router": "^2.6.0"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^7.1.1",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"cssnano": "^3.10.0",
"eslint": "^3.19.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^3.0.0",
"eslint-config-airbnb-base": "^11.1.3",
"eslint-import-resolver-webpack": "^0.8.1",
"eslint-plugin-import": "^2.2.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"webpack-bundle-analyzer": "^2.2.1",
"cross-env": "^5.0.1",
"karma": "^1.4.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^1.3.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.2",
"lolex": "^1.5.2",
"mocha": "^3.2.0",
"chai": "^3.5.0",
"sinon": "^2.1.0",
"sinon-chai": "^2.8.0",
"inject-loader": "^3.0.0",
"babel-plugin-istanbul": "^4.1.1",
"phantomjs-prebuilt": "^2.1.14",
"chromedriver": "^2.27.2",
"cross-spawn": "^5.0.1",
"nightwatch": "^0.9.12",
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"url-loader": "^0.5.8",
"vue-loader": "^12.1.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.3.3",
"webpack": "^2.6.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

Can you please help?

@gazpachu
Copy link
Owner Author

gazpachu commented Jun 8, 2022

Comment written by Alina Chernavskikh on 10/03/2017

Can you add some demo?

@gazpachu gazpachu added blog Blog posts work labels Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blog Blog posts work
Projects
None yet
Development

No branches or pull requests

1 participant