# vuepress-plugin-img-lazy ^1.3.7

TIP

You can modify the plugin options, or just use

Base URL (opens new window) already included by default

Live Demo (opens new window)

Source code (opens new window)

TIP

You need to know how to use it.

![img](/img.jpg)
<!-- or -->
![img](/img.jpg =500x300) <!-- better -->
<!-- or -->
<img-lazy src="/img.jpg" />

# Modify

TIP

You can control the img of markdown and theme (^1.4.0)

module.exports = {
  plugins: [
    [
      'img-lazy',
      { /* options */ }
    ]
  ]
}

# Options

# useNative

  • Type: Boolean
  • Default: true
  • Required: false

Use the native image lazy-loading for the web

TIP

In general, using native lazy loading will load more pictures than not using

# selector

  • Type: string
  • Default: lazy
  • Required: false

Default class name for image

# rootMargin

  • Type: String
  • Default: 200px
  • Required: false

rootMargin for IntersectionObserver

# prefix

  • Type: string Function
  • Default: src => src && src.charAt(0) === '/' && !src.startsWith(ctx.base) ? ctx.base + src.slice(1) : src
  • Required: false

Config prefix for src in images