Vue-On-Visible
A collection of Vue components aimed to help you create better interactions with as elements enter and exit the viewport.
Demo
This uses the Interaction Observer API
and includes a polyfill
enabling support in the following browsers:
Table of contents
Installation
npm install --save vue-on-visible
Importing
Option #1 - A Vue Plugin
Provides global access to all components
import Vue from 'vue'
import OnVisible from 'vue-on-visible'
Vue.use(OnVisible)
Usage
Pass your component or markup as a <slot>
:
<OnVisible >
<div>My Awesome Component</div>
</OnVisible>
Example