Detect a blog Post and get the view count with Intersection Observer on the Nuxt app
I want to count the post view on a page of my Nuxt app when user scroll to it .
I have a list of posts on a page and I am using Intersection Observer to count Post views. When a user scrolls to a Post up/down that post view count must be increased by 1. I am using Nuxt js here. Not sure whether my procedure is correct or not because it increases the number of counts by 10, as it’s on the foreach loop and posts loaded 10 per page (Maybe taking the loop count).