Home Examples Charts Dashboard Projects Menu

Vue.js examples
Learn Vue.js

vue lazyload images

Related:
Vue: Step-By-Step Guide To Mastering Vue.js From Beginner To Advanced (Vue.js, Learning Vue js 2)

A plugin of lazy-load images for Vue2.x
Support images lazyload in window or build-in element.

Component name: vue-lazyload-images

lazy load vue

Installation

You need npm to install this component, or include it manually.

npm

$ npm install vue-lazy-images

script

<script src="dist/VueLazyImages.js"></script>

Usage

Entry.js

import Vue from "vue"
import VueLazyImage from "vue-lazy-images";
Vue.use(VueLazyImage)

Template

<lazy-image 
:src='url'
:img-class='string' //or :img-class="['classname1','classname2']"
:placeholder='url of placeholder or loading image'
/>

Github: http://github.com/yyh1102/vue-lazyload-images#readme


© vuejsexamples.net - Privacy Policy - Cookie Policy