vue-visibility-trigger

0.1.4 • Public • Published

vue-visibility-trigger

Vue component that emits an event when scrolled into view

vue-visibility-trigger demo

Installation

Install the package from npm by running

$ yarn add vue-visibility-trigger

or

$ npm i vue-visibility-trigger

Usage

Import, register and place the component in your Vue app. Attach a function to react to the 'scrolledIn' event with 'v-on:scrolledIn="..."' or '@scrolledIn="..."'.

<template>
  ...
    <VueVisibilityTrigger @scrolledIn="doSomething" />
  ...
</template>

<script>
import VueVisibilityTrigger from 'vue-visibility-trigger'

export default {
  ...
  components: {
    VueVisibilityTrigger
  }
};
</script>

Dev

Running dev and example scripts require @vue/cli and @vue/cli-service-global to be installed. Install globally by running npm i --g @vue/cli @vue/cli-service-global or yarn add global vue/cli @vue/cli-service-global

Package Sidebar

Install

npm i vue-visibility-trigger

Weekly Downloads

33

Version

0.1.4

License

MIT

Unpacked Size

131 kB

Total Files

12

Last publish

Collaborators

  • shwilliam