- 博客(4)
- 收藏
- 关注
原创 Math.random()伪随机数漏洞修复方案
利用Web Cryptography API生成真随机数,修复因为Math.random生成伪随机数导致的漏洞
2022-09-16 17:14:11
5308
原创 【JS】用for of遍历对象,学习JS迭代器心得
这里写自定义目录标题JS迭代器给Object加迭代规则JS迭代器JS迭代器一直是想了解的内容,最近两天鼓足勇气啃了红宝书,小试牛刀给Object加迭代规则 Object.prototype[Symbol.iterator] = function() { let index = 0 let o=this return { next() { let keys = Object.keys(o) if(index < k
2022-05-12 15:55:16
237
原创 vue-router组件内导航守卫判断返回按钮
组件内导航守卫会出现无法拦截$router.go(-1)或者物理返回按钮,在拦截函数外包裹setTimeout即可。具体原因还未发现。 setTimeout(() => { this.$confirm('编辑的页面布局尚未保存,确定离开?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消',...
2020-01-22 14:57:17
1324
原创 document.execCommand实现复制到剪切板功能
handleClick(i) { const input = document.createElement('input'); input.value = i; document.body.appendChild(input); input.select(); if (document.execCommand('Copy')) { ...
2019-11-19 15:46:45
550
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人