Detect internet connection
Check the console below for results:
initially on line
Library: vue
console.log('Initially ' + (window.navigator.onLine ? 'on' : 'off') + 'line');
window.addEventListener('online', () => console.log('Became online'));
window.addEventListener('offline', () => console.log('Became offline'));
document.getElementById('statusCheck').addEventListener('click',
<button id="statusCheck">Click to check the <tt>window.navigator.onLine</tt> property</button><br /><br />
Check the console below for results:
// ORRRR NUXT WAY
https://stackoverflow.com/questions/66651204/how-to-detect-internet-connection-on-off-in-vuejs-nuxtjs
//ORRRR
https://medium.com/@android.bks/monitoring-the-internet-connection-in-your-vue-app-a9d3f3b5bbb2