refactor: use nuxt plugin to provide pwa helpers globally (#604)
This commit is contained in:
parent
73cec49cf0
commit
726a581add
4 changed files with 15 additions and 23 deletions
|
@ -1,13 +1,9 @@
|
|||
<script setup>
|
||||
import { pwa } from '~/composables/pwa'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
v-if="pwa.needRefresh"
|
||||
v-if="$pwa?.needRefresh"
|
||||
bg="fade" relative rounded
|
||||
flex="~ gap-1 center" px3 py1 text-primary
|
||||
@click="pwa.updateServiceWorker()"
|
||||
@click="$pwa.updateServiceWorker()"
|
||||
>
|
||||
<div i-ri-download-cloud-2-line />
|
||||
<h2 flex="~ gap-2" items-center>
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<script setup>
|
||||
import { pwa } from '~/composables/pwa'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="pwa.needRefresh"
|
||||
v-if="$pwa?.needRefresh"
|
||||
m-2 p5 bg="fade" relative
|
||||
rounded-lg of-hidden
|
||||
flex="~ col gap-3"
|
||||
|
@ -13,10 +9,10 @@ import { pwa } from '~/composables/pwa'
|
|||
{{ $t('pwa.title') }}
|
||||
</h2>
|
||||
<div flex="~ gap-1">
|
||||
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="pwa.updateServiceWorker()">
|
||||
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="$pwa.updateServiceWorker()">
|
||||
{{ $t('pwa.update') }}
|
||||
</button>
|
||||
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="pwa.close()">
|
||||
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="$pwa.close()">
|
||||
{{ $t('pwa.dismiss') }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue