Home > Web Front-end > JS Tutorial > body text

Introduction to the Vue-based lazy loading plug-in vue-view-lazy

不言
Release: 2018-07-04 11:54:18
Original
1777 people have browsed it

This article mainly introduces the lazy loading plug-in vue-view-lazy based on Vue, which can load pictures or other resources after entering the visible area. The content is quite good. I will share it with you now and give it as a reference. .

Lazy loading plug-in based on vue

Purpose: Load pictures or other resources after entering the visible area

Install and use

  1. Directly download vue-view-lazy.min.js in the dist directory and use

  2. Install using npm

Use directly

Copy after login

npm:

$ npm install --save-dev vue-view-lazy
Copy after login

Introducing vue-view-lazy

.main file

import vView from 'vue-view-lazy'
Vue.use(vView,{
  error:'../../static/images/loading.png',
  loading:'../../static/images/loading.gif',
});
Copy after login

Lazy loading of pictures

.vue file




Copy after login

Lazy loading data

.vue file





Copy after login

The above is the entire content of this article, I hope it will be helpful Everyone’s learning is helpful. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

Method to implement button-level permission control based on Vue custom instructions

Introduction to vue component name

The above is the detailed content of Introduction to the Vue-based lazy loading plug-in vue-view-lazy. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
vue
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!