1.0.0 • Published 9 years ago

vue-image v1.0.0

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

vue-image

experimental

A Vue directive that will insert an image from a preloader into the dom.

Usage

var Vue = require('vue');
Vue.use(require('vue-image'),{
  assetPath: '',
  preloader: require('preloader')
});

<img v-image="hero.image"/>

####clone#### <img v-content="{img: hero.image, clone: false}"/>

Clone the image returned fromm preloader.getContent(<img path>). Default is true. If set to false the same image for every directive that is returned from preloader.getContent(<img path>) is used and only one instance of the image can be present in the dom at one time.

####replace#### <div v-content="{img: hero.image, replace: true}"></div>

Replace the element with the image specified in the directive. If the directive element is an image than the default is true and probably should always be true. For any other element the default is false and the image is inserted as a child of that element.

NPM

License

MIT, see LICENSE.md for details.