Skip to content

Commit 8c9c6b5

Browse files
committed
docs(plugin-pwa): fix typo in code example
1 parent 9f6cffa commit 8c9c6b5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/reference/plugin/pwa.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ import { usePwaEvent } from '@vuepress/plugin-pwa/lib/composables'
120120

121121
export default {
122122
setup() {
123-
event = usePwaEvent()
123+
const event = usePwaEvent()
124124
event.on('ready', (registration) => {
125125
console.log('Service worker is active.')
126126
})
@@ -150,7 +150,7 @@ import {
150150

151151
export default {
152152
setup() {
153-
event = usePwaEvent()
153+
const event = usePwaEvent()
154154
event.on('updated', (registration) => {
155155
console.log('The waiting service worker is available.')
156156
// activate the waiting service worker

docs/zh/reference/plugin/pwa.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ import { usePwaEvent } from '@vuepress/plugin-pwa/lib/composables'
120120

121121
export default {
122122
setup() {
123-
event = usePwaEvent()
123+
const event = usePwaEvent()
124124
event.on('ready', (registration) => {
125125
console.log('Service worker 已经生效。')
126126
})
@@ -150,7 +150,7 @@ import {
150150

151151
export default {
152152
setup() {
153-
event = usePwaEvent()
153+
const event = usePwaEvent()
154154
event.on('updated', (registration) => {
155155
console.log('在 Waiting 状态的 Service Worker 已经就绪。')
156156
// 激活 Waiting 状态的 Service Worker

0 commit comments

Comments
 (0)