Answer the question
In order to leave comments, you need to log in
How to make a component reload triggered by any click anywhere on the site?
I need to reload the ad component no more than once every 30 seconds, and so that the reload will work when clicking anywhere on the site. For example, the user replied to a comment or clicked a like, and if the date recorded in the global variable is more than 30 seconds than the current date, then the reload of the ad component is triggered.
The question is exactly how to track any click anywhere on the site and reload the component?
Answer the question
In order to leave comments, you need to log in
Set the key to the desired component (componentKey = 1) using the :key directive. When clicking on the document, update the component by increasing the value of the key by one (componentKey++). Write down the time of the last click and then build the logic of the next click based on the time of the last click on the document.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question