mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 05:18:10 +00:00
pwa: automatyczny reload
This commit is contained in:
+3
-1
@@ -69,7 +69,9 @@ export default defineComponent({
|
||||
}),
|
||||
|
||||
async created() {
|
||||
const stockData = await (await fetch(`https://spythere.github.io/api/stockDataNew.json?t=${Math.floor(Date.now() / 60000)}`)).json();
|
||||
const stockData = await (
|
||||
await fetch(`https://spythere.github.io/api/stockDataNew.json?t=${Math.floor(Date.now() / 60000)}`)
|
||||
).json();
|
||||
|
||||
this.store.stockData = stockData;
|
||||
},
|
||||
|
||||
+11
-3
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user