PWA
This commit is contained in:
parent
9cde9b5cf7
commit
f3927b97a4
21 changed files with 8672 additions and 202 deletions
15
src/main.ts
15
src/main.ts
|
|
@ -3,8 +3,23 @@ import App from './App.vue'
|
|||
import router from './router'
|
||||
import { i18n } from './i18n'
|
||||
import './assets/index.css'
|
||||
import { registerSW } from 'virtual:pwa-register'
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(router)
|
||||
app.use(i18n)
|
||||
|
||||
// Simple periodic service worker updates
|
||||
const intervalMS = 60 * 60 * 1000 // 1 hour
|
||||
registerSW({
|
||||
onRegistered(r) {
|
||||
r && setInterval(() => {
|
||||
r.update()
|
||||
}, intervalMS)
|
||||
},
|
||||
onOfflineReady() {
|
||||
console.log('App ready to work offline')
|
||||
}
|
||||
})
|
||||
|
||||
app.mount('#app')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue