1.0.11 • Published 6 years ago

vt-lazyload-plugin v1.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Lazyload plugin

Really small lazyload plugin (<4kB)

How to install:

  1. Install the package:

    #install the npm package
    
    npm i vt-lazyload-plugin
  2. Import/use plgun:

    import Vue from 'vue'
    import lazyLoad from 'vt-lazyload-plugin'
    
    Vue.use(lazyLoad)

How to use:

Add the v-lazyLoad directive with the src of the image as attribute value.

Do not add the src Attribute or else that lazyload wont work.

with link:

 <img v-lazyLoad="https://via.placeholder.com/350x150" />

with prob/variable:

 <img v-lazyLoad="image.src" />

Options:

how to add a option:

add a object to the Vue.use(lazyload)

Vue.use(lazyLoad, {margin: '0px 0px 100px 0px'})

Options:

OptionTypeDefault valueDescription
marginstring'0px 0px 100px 0px'Sets the distance between the viewport and the image before it gets loaded
fadeInstring'false'If you want the images to fade in when scrolling by, set the value to any amount of seconds you want e.g. '1s'
1.0.9

6 years ago

1.0.8

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago