mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-03 19:33:58 +00:00
feat: provide an emit
This commit is contained in:
parent
9ac1261662
commit
84b0a71b8c
@ -1,5 +1,6 @@
|
||||
import { defineComponent } from "vue"
|
||||
export default defineComponent({
|
||||
emits: ['intersected'],
|
||||
setup() {
|
||||
const data = ref(null);
|
||||
const isIntersecting = ref(false);
|
||||
@ -10,6 +11,7 @@ export default defineComponent({
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
isIntersecting.value = true;
|
||||
emit('intersected');
|
||||
observer.unobserve(target.value);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user