Skip to content

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

License

Notifications You must be signed in to change notification settings

isabella232/vue-image

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%