fix: rework setup to improve SSR compatibility
This commit is contained in:
parent
fd7d30a38a
commit
d8d163dbd0
22 changed files with 137 additions and 73 deletions
|
@ -1,15 +1,10 @@
|
|||
import { useRegisterSW } from 'virtual:pwa-register/vue'
|
||||
|
||||
export const usePWA = () => {
|
||||
export function usePWA() {
|
||||
const online = useOnline()
|
||||
|
||||
useHead({
|
||||
meta: [{ id: 'theme-color', name: 'theme-color', content: computed(() => isDark.value ? '#111111' : '#ffffff') }],
|
||||
})
|
||||
|
||||
const {
|
||||
needRefresh,
|
||||
updateServiceWorker,
|
||||
needRefresh, updateServiceWorker,
|
||||
} = useRegisterSW({
|
||||
immediate: true,
|
||||
onRegisteredSW(swUrl, r) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue