pwa: automatyczny reload

This commit is contained in:
2023-01-03 01:29:15 +01:00
parent 6a10b1e191
commit 242be73c78
4 changed files with 19 additions and 6 deletions
+11 -3
View File
@@ -1,10 +1,18 @@
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import { registerSW } from 'virtual:pwa-register';
import App from './App.vue';
const pinia = createPinia();
createApp(App)
.use(pinia)
.mount('#app');
const updateSW = registerSW({
onOfflineReady() {},
onNeedRefresh() {
console.log('Need refresh!');
},
});
createApp(App).use(pinia).mount('#app');