main.js:
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/sw.js')
.then(registration => {
console.log('加载wroker成功', registration);
}).catch(registrationError => {
console.log('加载wroker失败', registrationError);
});
});
2***@qq.com
- 发布:2020-03-27 17:22
- 更新:2020-10-12 14:52
- 阅读:633
uni-app内无法使用workbox嘛
分类:HBuilderX
1 个回复
丘公子哦 - 戒奢从简
现在使用成功了吗?