summaryrefslogtreecommitdiff
path: root/packages/client/src/directives/appear.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/client/src/directives/appear.ts')
-rw-r--r--packages/client/src/directives/appear.ts22
1 files changed, 0 insertions, 22 deletions
diff --git a/packages/client/src/directives/appear.ts b/packages/client/src/directives/appear.ts
deleted file mode 100644
index 7fa43fc34a..0000000000
--- a/packages/client/src/directives/appear.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Directive } from 'vue';
-
-export default {
- mounted(src, binding, vn) {
- const fn = binding.value;
- if (fn == null) return;
-
- const observer = new IntersectionObserver(entries => {
- if (entries.some(entry => entry.isIntersecting)) {
- fn();
- }
- });
-
- observer.observe(src);
-
- src._observer_ = observer;
- },
-
- unmounted(src, binding, vn) {
- if (src._observer_) src._observer_.disconnect();
- },
-} as Directive;