lazy_loading_vue

Vuejs custom directive for lazy loading
1,405
Install
npm install lazy_loading_vue
Latest Version:0.4.6
License:ISC
Last Updated:Feb 27, 2023
Links: GitHub  ·  npm
Maintainer: alex-ko

lazy_loading_vue

Vuejs custom directive for lazy loading.

This directive works by following the last element in the list, and when you scroll to it, your function is called where you can add more content. You can also use a loader that will be visible until more content is added.

Example

Example on CodeSandbox

Installation

npm install lazy_loading_vue --save

Usage example

Globally register custom directives at the app level:

import VLazyLoader from "lazy_loading_vue";

const app = createApp(App);

app.directive("lazy", VLazyLoader);

An example of using a directive:

Be sure to add the lazy-item class to each item in the list.

<template>
  <div class="wrapper" v-lazy:loader="exampleFuncLoadMorePosts">
    <div class="lazy-item" v-for="item in items" :key="item.id">
      <div class="title">{{ item.title }}</div>
      <div class="body">{{ item.body }}</div>
    </div>
  </div>
</template>

Related Packages

vue3-highlight-text

a vue3 directive of highlight text

84,789
vue-proportion-directive

vue 固定元素比例指令

6,003 10
ardirectives

Ardirectives

811
vue-on-click-outside

vue mixin/directive that does something when you click outside a container

169,297 31
vue-bind-once

A tiny, SSR-safe directive for binding random data to an element.

152,016 169

Version History

Version Released License
0.4.6 ISC
0.4.5 ISC
0.4.4 ISC
0.4.3 ISC
0.4.2 ISC