1.0.1 • Published 9 years ago

vue-svg v1.0.1

Weekly downloads
49
License
MIT
Repository
github
Last release
9 years ago

vue-svg

experimental

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>

NPM

License

MIT, see LICENSE.md for details.