npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-oe-lazy

v1.0.3

Published

## intro a plugin of vue for image lazyload, especially optimized for mobile browser

Downloads

5

Readme

vue-lazyload-img

intro

a plugin of vue for image lazyload, especially optimized for mobile browser

demo

  • support require.js(AMD),sea.js(CMD),webpack(CommonJs)
  • detect image's visibility not only from vertical direction, but also horizontal
  • detect scrolling speed, when scrolling speed is faster than threshold, image will not be loaded

API

init

Vue.use(Vue.lazyLoad[,options])

options

global options

fadein: all images will use fadein fx

  • true: all images will fadein if lazyload Complete
  • false (default): no fadein fx of all

nohori: disable lazyload from horizontal direction

  • true: all images will not detect horizontal direction
  • false (default): detect horizontal direction

speed: threshold of loading lazyload iamge

  • 0 (default): load lazy-image when the image is visible at the 1st time
  • 0 (recommend 20): average changes of document y-pos and any scroller's x-pos from last 10 frames, awesome in mobile browsers

Vue.use(Vue.lazyLoad,{
    fadein: true,
    nohori: true,
    speed: 20,
})

directive

v-lazy

  • v-lazy="src"
  • v-lazy:opt.nohri="src"
  • v-lazy:opt.fadein="src"
  • v-lazy:opt.nohri.fadein="src"

介绍

vue图片懒加载插件,特别为移动端优化
  • 十字方向检测图片是否可显示,不仅能做到上下滚动懒加载,还能做到水平方向懒加载
  • 监测屏幕滚动速率,阈值可自定义,尤其适合移动端,比如屏幕快速向下滑动,其间的图片不会被加载
  • 可选的淡入特效

API

初始化

Vue.use(Vue.lazyload[,options])

options(可选参数)

全局选项

fadein: 全部图片使用淡入特效

  • true: 所有的图片都会使用淡入特效
  • false (默认): 不使用淡入特效

nohori: 禁用水平方向的检测

  • true: 禁用水平方向的检测
  • false (默认): 不禁用水平方向的检测

speed: 速度检测的临界值

  • 0 (默认): 只要图片在屏幕里出现了,那么图片就开始懒加载
  • 0 (推荐 20): 只有当屏幕滚动速度小于speed且图片在屏幕中出现了才开始懒加载

Vue.use(Vue.lazyload,{
    fadein: true,
    nohori: true,
    speed: 20,
})

directive

v-lazy

  • v-lazy="src"
  • v-lazy:opt.nohri="src"
  • v-lazy:opt.fadein="src"
  • v-lazy:opt.nohri.fadein="src"