vue3-lazy
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.1 • Public • Published

vue3-lazy

Status: Alpha.

Lazy load plugin for Vue 3.x inspired by vue-lazyload.

This plugin support very simple options, and easy to use.

Install

$ npm install vue3-lazy -S

Usage

main.js:

import { createApp } from 'vue'
import App from './app'
import lazyPlugin from 'vue3-lazy'
 
const app = createApp(App)
lazyPlugin.install(app, {
  loading: 'loading.png',
  error: 'error.png'
})
app.mount('#app')

template:

<ul>
  <li v-for="img in list">
    <img v-lazy="img.src" >
  </li>
</ul>

Lazy Options

key description default options
error src of the image upon load fail 'data-src' String
loading src of the image while loading 'data-src' String

Readme

Keywords

none

Package Sidebar

Install

npm i vue3-lazy

Weekly Downloads

435

Version

1.0.0-alpha.1

License

none

Unpacked Size

96 kB

Total Files

39

Last publish

Collaborators

  • ustbhuangyi