摘要:
const fs = window.require('fs').promises // const path = window.require('path') const fileHelper = { readFile:(path) => { return fs.readFile(path,{enc 阅读全文
posted @ 2022-02-07 21:09
13522679763-任国强
阅读(32)
评论(0)
推荐(0)
摘要:
export const flattenArr = (arr) => { return arr.reduce((map,item)=>{ map[item.id] = item return map },{}) } export const objToArr = (obj) => { return 阅读全文
posted @ 2022-02-07 21:09
13522679763-任国强
阅读(25)
评论(0)
推荐(0)
摘要:
async function renderMovie(){ const res = await fetch('/api/getMovie') const json = await res.json() let data = json.data.house43 console.log(data); l 阅读全文
posted @ 2022-02-07 15:26
13522679763-任国强
阅读(44)
评论(0)
推荐(0)
摘要:
// install 主要就是缓存内容 const CACHE_NAME = 'cahe_v1' const URLS = [ '/', '/index.css', '/images/1.png', '/index.js', '/manifest.json', '/api/66462d0145d35 阅读全文
posted @ 2022-02-07 15:26
13522679763-任国强
阅读(228)
评论(0)
推荐(0)
摘要:
service worker 使用步骤 <script> // 1 在网页加载完成的时候 注册 service worker window.addEventListener('load', () => { // 2 能力检测 if ('serviceWorker' in navigator) { n 阅读全文
posted @ 2022-02-07 15:25
13522679763-任国强
阅读(53)
评论(0)
推荐(0)
摘要:
/** * 如果页面一进来, 发现用户没有联网,给用户发一个通知 * */ if(Notification.permission 'default'){ Notification.requestPermission() } if(!navigator.onLine){ new Notificatio 阅读全文
posted @ 2022-02-07 15:25
13522679763-任国强
阅读(82)
评论(0)
推荐(0)
摘要:
manifest 使用步骤 1 新建一个 manifest.json 文件 2 在 index.html 引入 manifest.json 文件 3 在 manifest.json 文件中提供常见的配置 4 需要在 https 协议或者 http://localhost 下访问项目 <link re 阅读全文
posted @ 2022-02-07 15:24
13522679763-任国强
阅读(403)
评论(0)
推荐(0)

浙公网安备 33010602011771号