vue-svg
Vue directive that will add a svg from an svg sprite sheet to an element.
1,219
4
| Install | |
|---|---|
npm install vue-svg |
|
| Latest Version: | 1.0.1 |
| License: | MIT |
| Last Updated: | Sep 24, 2015 |
| Links: | GitHub · npm |
Maintainer: brendanneufeld
vue-svg
A Vue directive that will add a svg from a svg sprite sheet to an element.
Usage
var fs = require('fs');
var Vue = require('vue');
Vue.use(require('vue-svg'),{
sprite: fs.readFileSync(__dirname + 'sprites.svg', 'utf8'),
prefix: 'svg-sprite--'
});
You will need a grunt or gulp task to concatenate your individual svgs into a single file. Sometimes these tasks will add a prefix to namespace the individual svgs. Just add this prefix to the options and use the individual file name in the directive as follows:
<div v-svg="close-icon"></div>
License
MIT, see LICENSE.md for details.
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.0.1 | MIT | |
| 1.0.0 | MIT |
