All Projects → apertureless → vue-observable

apertureless / vue-observable

Licence: MIT license
IntersectionObserver, MutationObserver and PerformanceObserver in Vue.js

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects

Projects that are alternatives of or similar to vue-observable

svelte-inview
A Svelte action that monitors an element enters or leaves the viewport.🔥
Stars: ✭ 358 (+1391.67%)
Mutual labels:  viewport, intersection-observer
react-awesome-reveal
React components to add reveal animations using the Intersection Observer API and CSS Animations.
Stars: ✭ 564 (+2250%)
Mutual labels:  viewport, intersection-observer
vue-in-viewport-mixin
Vue 2 mixin to determine when a DOM element is visible in the client window
Stars: ✭ 99 (+312.5%)
Mutual labels:  viewport, intersection-observer
svelte-intersection-observer
Detect if an element is in the viewport using the Intersection Observer API
Stars: ✭ 151 (+529.17%)
Mutual labels:  viewport, intersection-observer
react-spring-pop
Animate React elements when they enter the viewport with physics based animations
Stars: ✭ 17 (-29.17%)
Mutual labels:  viewport, intersection-observer
React Intersection Observer
React implementation of the Intersection Observer API to tell you when an element enters or leaves the viewport.
Stars: ✭ 2,689 (+11104.17%)
Mutual labels:  viewport, intersection-observer
vue2-element
基于vue2 + vue-router2 + element-ui + vuex2 + fetch + webpack2 企业级后台管理系统最佳实践
Stars: ✭ 115 (+379.17%)
Mutual labels:  vue2
vue-mxgraph-samples
在 vue2 中使用 mxgraph 的一些用例 / used mxgraph in vue2
Stars: ✭ 16 (-33.33%)
Mutual labels:  vue2
vue-add-to-calendar
A Vue.js component that provides "Add to Calendar" functionality, works with Vue 2.X
Stars: ✭ 133 (+454.17%)
Mutual labels:  vue2
metana
Abstract task migration tool written in Go for Golang services. Database and non database migration management brought to the CLI.
Stars: ✭ 61 (+154.17%)
Mutual labels:  abstract
changed-files
Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.
Stars: ✭ 733 (+2954.17%)
Mutual labels:  change-detection
vuejs2-wysiwyg
jQuery Summernote WYSIWYG Editor implementation for REST based single page applications that run on vue.js 2.0.
Stars: ✭ 15 (-37.5%)
Mutual labels:  vue2
message
基于 Vue2.x 的消息提示组件。Vue-based message component
Stars: ✭ 26 (+8.33%)
Mutual labels:  vue2
vue-on-click-outside
vue mixin/directive that does something when you click outside a container
Stars: ✭ 32 (+33.33%)
Mutual labels:  vue2
JianshuVue2.0
简书demo page by vue2
Stars: ✭ 14 (-41.67%)
Mutual labels:  vue2
react-scroll-trigger
📜 React component that monitors scroll events to trigger callbacks when it enters, exits and progresses through the viewport. All callback include the progress and velocity of the scrolling, in the event you want to manipulate stuff based on those values.
Stars: ✭ 126 (+425%)
Mutual labels:  viewport
monolazy
Extended nanocomponent providing onEnter callback
Stars: ✭ 21 (-12.5%)
Mutual labels:  intersection-observer
vue-drr
A Vue2 component for draggable, resizable, rotatable elements
Stars: ✭ 34 (+41.67%)
Mutual labels:  vue2
vue-analytics-facebook-pixel
A small wrapper around Facebook Pixel API
Stars: ✭ 23 (-4.17%)
Mutual labels:  vue2
taeseung vimrc
Taeseung Lee's vim setting
Stars: ✭ 16 (-33.33%)
Mutual labels:  viewport

vue-observable

npm vue2

Abstract Vue Components to utilizing the IntersectionObserver, MutationObserver and ResizeObserver Browser APIs

🔥 Please keep in mind that you will need polyfills

🔧 Installation

npm install --save vue-observable

👈 Usage

Componentlist

Bundler (Webpack, Rollup)

import Vue from 'vue'
import VueObservable from 'vue-observable'

Vue.use(VueObservable)

or

import {Intersect, Mutation, Resize} from 'vue-observable'

export default {
  components: {Intersect, Mutation, Resize}
}

Browser

<!-- Include after Vue -->
<!-- Local files -->
<script src="vue-observable/dist/vue-observable.js"></script>

<!-- From CDN -->
<script src="https://unpkg.com/vue-observable"></script>

📒 Components

IntersectionObserver - <intersect>

The <intersect> component will detect if a given element is in the viewport. And emit an event.

Props

Prop Required Default
root no null
rootMargin no 0px 0px 0px 0px
threshold no [0, 0.2]

Events

  • enter
  • leave
  • change

Usage

<intersect @enter="enterMethod" @leave="leaveMethod" @change="changeMethod">
  <some-component-or-node>
</intersect>

MutationObserver - <Mutation>

Props

Prop Required Default
attributeFilter no null
attributeOldValue no null
attributes no false
characterData no null
characterDataOldValue no null
childList no false
subtree no false

Events

  • mutation

Usage

<mutation @mutation="mutationMethod">
  <some-component-or-node>
</mutation>

ResizeObserver - <resize>

Props

N/A

Events

  • resize

Usage

<resize @resize="resizeMethod">
  <some-component-or-node>
</resize>

Development

Launch visual tests

npm run dev

Launch Karma with coverage

npm run dev:coverage

Build

Bundle the js and css of to the dist folder:

npm run build

Publishing

The prepublish hook will ensure dist files are created before publishing. This way you don't need to commit them in your repository.

# Bump the version first
# It'll also commit it and create a tag
npm version
# Push the bumped package and tags
git push --follow-tags
# Ship it 🚀
npm publish

License

MIT

Support

Buy Me A Coffee

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].