Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
vuepress-plugin-img-lazy
Advanced tools
a vuepress plugin to better supporting image lazy loading
a vuepress plugin to better supporting image lazy loading
The plugin will preferentially use native image lazy-loading, if the browser does not support it, it will be implemented through IntersectionObserver
base on markdown-it-img-lazy and markdown-it-imsize
yarn add vuepress-plugin-img-lazy
# or
npm i vuepress-plugin-img-lazy
module.exports = {
plugins: [
'img-lazy'
]
}
![img](/img.jpg)
# or
![img](/img.jpg =500x300) <!-- better -->
// enhanceAppFile.js
import ImgLazy from 'vuepress-plugin-img-lazy/ImgLazy'
export default ({ Vue }) => {
Vue.component(ImgLazy.name, ImgLazy)
}
import ImgLazy from 'vuepress-plugin-img-lazy/ImgLazy'
export default {
components: { ImgLazy }
}
<template>
<img-lazy src="/img.jpg" />
</template>
If you registered as global components, you can use it directly in the markdown
file
<img-lazy src="/img.jpg" />
Boolben
true
false
Use the native image lazy-loading for the web
string
lazy
false
Default class name for image
String
200px
false
rootMargin for IntersectionObserver
string
Function
src => src && src.charAt(0) === '/' && !src.startsWith(ctx.base) ? ctx.base + src.slice(1) : src
false
Config prefix for src in images
<img/>
label in the markdown file If you need to use both Base URL
and <img/>
labels, refer to
<img :data-src="$withBase('/img.png')" loading="lazy" class="lazy">
display
as inline block
or block
separately), so as to ensure that the image can occupy the position it should occupyFAQs
a vuepress plugin to better supporting image lazy loading
The npm package vuepress-plugin-img-lazy receives a total of 97 weekly downloads. As such, vuepress-plugin-img-lazy popularity was classified as not popular.
We found that vuepress-plugin-img-lazy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.