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
Directly download vue-view-lazy.min.js in the dist directory and use
Install using npm
Use directly
npm:
$ npm install --save-dev vue-view-lazy
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', });
Lazy loading of pictures
.vue file
Lazy loading data
.vue file
getAjaxContent(e,v.msg)"> loading...
loading...
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!