vue-image

1.0.0 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i vue-image

      Weekly Downloads

      3

      Version

      1.0.0

      License

      MIT

      Last publish

      Collaborators

      • brendanneufeld