上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: tree shaking [ʃeɪk] v.摇;发抖;震动;动摇 n.抖动;摇动;颤动 即 webpack 在打包的过程中会将没用的代码进行清除(dead code)。 一般 dead code 具有一下的特征: 代码不会被执行,不可到达 代码执行的结果不会被用到 代码只会影响死变量(只写不读) 使 阅读全文
posted @ 2021-07-12 16:03 瑞瑞大人 阅读(72) 评论(0) 推荐(0) 编辑
摘要: background: linear-gradient(180deg, #ff5289 0%, #f7f7f8 100%), #f7f7f8; background-repeat: no-repeat; background-size: 100% 1.8rem; 高度为1.8rem的linear-g 阅读全文
posted @ 2021-06-30 17:46 瑞瑞大人 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 在后退的界面上添加 判断是否是返回window.addEventListener('pageshow', function (e) { if(e.persisted || (window.performance && window.performance.navigation.type == 2)) 阅读全文
posted @ 2021-06-30 11:19 瑞瑞大人 阅读(313) 评论(0) 推荐(0) 编辑
摘要: generator和函数不同的是,generator由function*定义(注意多出的*号)除了return语句,还可以用yield返回多次 function* test() { let x = 1 yield x + 1; yield x + 2; return x + 3; } const g 阅读全文
posted @ 2021-06-29 17:44 瑞瑞大人 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 监听页面返回 popstate 当活动历史记录条目更改时,将触发popstate事件。如果被激活的历史记录条目是通过对history.pushState()的调用创建的,或者受到对history.replaceState()的调用的影响,popstate事件的state属性包含历史条目的状态对象的副 阅读全文
posted @ 2021-06-28 10:39 瑞瑞大人 阅读(446) 评论(0) 推荐(0) 编辑
摘要: interface File { type: 'js'|'css'; url: string; } type libKey = 'mtstatSdk'|'elementUI'|'weChatJSSDK'; const libMap: Record<libKey, { files: File[]; l 阅读全文
posted @ 2021-06-25 10:55 瑞瑞大人 阅读(99) 评论(0) 推荐(0) 编辑
摘要: export function getItemKeyList(): Array<string> { const keyList = []; for (let i = 0; i < localStorage.length; i += 1) { const key = localStorage.key( 阅读全文
posted @ 2021-06-25 10:52 瑞瑞大人 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 一行 overflow: hidden; white-space: nowrap; text-overflow: ellipsis; 多行 display: -webkit-box; overflow: hidden; text-overflow: ellipsis; word-break: bre 阅读全文
posted @ 2021-06-21 14:05 瑞瑞大人 阅读(95) 评论(0) 推荐(0) 编辑
摘要: w3c的方法是e.preventDefault(),IE则是使用e.returnValue = false; 或者使用return false 默认事件有 a链接的点击 表单提交 阅读全文
posted @ 2021-05-06 15:50 瑞瑞大人 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 不加阻止事件冒泡和事件捕获时的执行顺序: 绑定事件 element.addEventListener(event, function, useCapture) useCapture:可选。布尔值,指定事件是否在捕获或冒泡阶段执行。 true - 事件句柄在捕获阶段执行; false- 默认。事件句柄 阅读全文
posted @ 2021-05-06 15:22 瑞瑞大人 阅读(37) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页