Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 343 Bytes

File metadata and controls

22 lines (16 loc) · 343 Bytes

useMutationObserver

Watch for changes being made to the DOM tree.

Usage

<script setup>
import { ref } from 'vue'
import { useMutationObserver } from 'vue-observer-hooks'

const el = ref(null)

useMutationObserver(el, (mutation) => {
  // todo...
}, { attributes: true })
</script>

<template>
  <div ref="el" />
</template>