New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@techassi/vue-lazy-image

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

@techassi/vue-lazy-image

This plugin lets you lazy load images making use of IntersectionObserver

1.0.0
unpublished
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

vue-lazy-image

This plugin lets you lazy load images making use of IntersectionObserver. This plugin is Vue V3 compatible.

Planned features

  • Observe images based on class instead of unique ids (make it configurable trough options)

Usage

Installation

npm install @techassi/vue-lazy-image --save

or

yarn add @techassi/vue-lazy-image

Basic usage

main.js

import { createApp } from 'vue';
import App from './App.vue';

import VueLazyImage from 'vue-lazy-image';

createApp(App).use(VueLazyImage).mount('#app');

YourComponent.vue

<template>
    <lazy-image :src="PATH_TO_IMAGE" :id="UNIQUE_ID"></lazy-image>
</template>

Advanced usage

main.js

import { createApp } from 'vue';
import App from './App.vue';

import VueLazyImage from 'vue-lazy-image';

const intersectionObserverOptions = {};
createApp(App).use(VueLazyImage, intersectionObserverOptions).mount('#app');

YourComponent.vue

<template>
    <lazy-image
        :src="PATH_TO_IMAGE"
        :id="UNIQUE_ID"
        :use-picture="TRUE / FALSE"
        @EVENT="CALLBACK"
    ></lazy-image>
</template>

For detailed Intersection observer options see here

Available Events
  • @intersected: This event triggers when the image intersects with the viewport
  • @loaded: This event triggers when the image is loaded
  • @error: This event triggers when there was an error loading the image

Contributing / Building

Contributions and pull request are welcome!

cd vue-lazy-image
yarn install / npm install
yarn run build / npm run build

Keywords

vue

FAQs

Package last updated on 08 Oct 2020

Did you know?

Socket

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.

Install

Related posts