M
M
Mr_Romanov2019-04-08 17:26:21
Vue.js
Mr_Romanov, 2019-04-08 17:26:21

How to detect user is on page or not in VUEJS?

How to understand on the page now the user or the tab in the background?
I do SPA but with a router and you can sit in 3/4 tabs in one application, there is a common method that from time to time sends something to the user in the form of a notification, I want to send a notification only to the tab in which the user is located or to which he will return first, how to determine this without jquery?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2019-04-08
@Mr_Romanov

Use window.onfocus and window.onblur

A
Andrey Andreev, 2019-04-08
@b0nn1e

https://www.google.com/search?q=active+window+java...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question