mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
5059c57f4a
* ✨ Added `utils` module. Moved `canvasHelpers` and old `utils.ts` file to it * ✨ Moved rest of utils and helpers * ⚡ Fixing sytax errors * 🔨 Refactoring new utils files * 🔨 Organizing imports, adding comments and a bit more refactoring * ✔️ Fixing tests * 🔨 Moving mixins to `src`
31 lines
580 B
Vue
31 lines
580 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>
|