mrTimofey / vue-ssr-starter

Starter kit for projects with Webpack 4, Vue 2 and SSR
53 stars 15 forks source link

how to use svg-sprites in this repo? #2

Closed liamwang closed 7 years ago

liamwang commented 7 years ago

Can you just make some pages to demonstrate how to use some features like svg-sprites of this repo?

And, thanks for your great effort on this repo. I'v learnt a lot.

mrTimofey commented 7 years ago

Thank you, very appreciated :)

Icons are also here, in testable branch. Usage is demonstrated here.

I am going to make more illustrative and community-ready examples. But right now there are too many things that can be dramatically changed after some real production experience.

You can read some info from README`s application structure section (assets/sprite.svg, assets/icons, build/svg-sprite).

There is the npm command npm run build:sprites which will generate the assets/sprite.svg file with all svg files from assets/icons folder (it is executed with npm run build as well). This file is imported and inserted to the application page automatically so there are no more actions needed to use the icons.

In your templates you can just use the icon(name="svg-icon-file-name") component which is implicitly imported from the components/shared/icon file.

liamwang commented 7 years ago

That's greate! Thanks!