mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 11:33:02 +00:00
chore: pwa update prompt
This commit is contained in:
10
src/pwa.ts
Normal file
10
src/pwa.ts
Normal file
@@ -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