mirror of
https://git.um-react.app/um/um-react.git
synced 2026-11-30 00:46:59 +00:00
chore: pwa update prompt
This commit is contained in:
1 parent
1566c0ffcb
commit
022c9d1eac
3 files changed
+20
-1
No files matched your search
+10
@@ -0,0 +1,10 @@
|
||||
import { registerSW } from 'virtual:pwa-register';
|
||||
|
||||
const updateSW = registerSW({
|
||||
onNeedRefresh() {
|
||||
if (confirm('应用程序已更新,是否刷新?')) {
|
||||
updateSW();
|
||||
}
|
||||
},
|
||||
onOfflineReady() {},
|
||||
});
|
||||
Reference in new issue
Block a user