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

vue-mutation-observer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-mutation-observer

VueJS directive to observe changes in DOM use MutationObserver API

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
268
decreased by-1.83%
Maintainers
1
Weekly downloads
 
Created
Source

vue-mutation-observer

VueJS directive to observe changes in DOM use MutationObserver API

Install

npm install vue-mutation-observer

or

yarn add vue-mutation-observer

CommonJS

You can use any build tool which supports commonjs:

// register globally
const observer =  require('vue-mutation-observer');
Vue.use(observer)

// or for a single instance
const { observer } = require('vue-mutation-observer');
new Vue({
  directives: { observer }
})

Or in ES2015:

// register globally
import observer from 'vue-mutation-observer'
Vue.use(observer)

// or for a single instance
import { observer } from 'vue-mutation-observer'
new Vue({
  directives: { observer }
})

Usage

Use v-observer directive to observe DOM mutations in node and it's children.

<div v-observer:subtree.childList="handler">
  // some content here
</div>

import { observer } from 'vue-mutation-observer'

export default {
  directives: { observer },
  methods: {
    handler (mutations) { console.log(mutations) }
  }
}

Arguments

ArgumentDescription
subtreeExtend monitoring to the entire subtree of node. All of the other properties are then extended to all of the nodes in the subtree instead of applying solely to the target node.

Modifiers

ModifierDescription
characterDataAdd properties characterData and characterDataOldValue to observer configuration
attributesAdd properties attributes and attributeOldValue to observer configuration
childListAdd property childList to observer configuration

If no modifiers is define - all properties in config will be defines as true.
MutationObserver configuration

Value

Value may be a function, which handle your mutation or an object with two properties: callback and config.

Keywords

FAQs

Package last updated on 13 Aug 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc