mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
5ca2148c7e
* ⚡ Adjust `format` script * 🔥 Remove exemption for `editor-ui` * 🎨 Prettify * 👕 Fix lint
30 lines
579 B
Vue
30 lines
579 B
Vue
<template>
|
|
<span ref="observed">
|
|
<slot></slot>
|
|
</span>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import mixins from 'vue-typed-mixins';
|
|
import emitter from '@/mixins/emitter';
|
|
|
|
export default mixins(emitter).extend({
|
|
name: 'IntersectionObserved',
|
|
props: ['enabled'],
|
|
mounted() {
|
|
if (!this.$props.enabled) {
|
|
return;
|
|
}
|
|
|
|
this.$nextTick(() => {
|
|
this.$dispatch('IntersectionObserver', 'observe', this.$refs.observed);
|
|
});
|
|
},
|
|
beforeDestroy() {
|
|
if (this.$props.enabled) {
|
|
this.$dispatch('IntersectionObserver', 'unobserve', this.$refs.observed);
|
|
}
|
|
},
|
|
});
|
|
</script>
|