build:v1.3.3; workflow: added vue-composition-api; feat: moved app status to about page, this closes #6; chore: removed style scripts from package.json
This commit is contained in:
13
src/use/online.js
Normal file
13
src/use/online.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ref } from '@vue/composition-api'
|
||||
|
||||
const isOnline = ref(navigator.onLine)
|
||||
|
||||
window.addEventListener('online', () => {
|
||||
isOnline.value = true
|
||||
})
|
||||
|
||||
window.addEventListener('offline', () => {
|
||||
isOnline.value = false
|
||||
})
|
||||
|
||||
export const useOnline = () => ({ isOnline })
|
||||
Reference in New Issue
Block a user