1 2 3 4
摘要: 1. ES5和ES6继承方式区别 ES5定义类以函数形式, 以prototype来实现继承 ES6以class形式定义类, 以extend形式继承 2. Generator了解 ES6 提供的一种异步编程解决方案, Generator 函数是一个状态机,封装了多个内部状态。 function* he 阅读全文
posted @ 2021-02-23 09:48 无序 阅读(75) 评论(0) 推荐(0)
摘要: getFloat = (num, n) => { n = n ? parseInt(n) : 0; if(n <= 0) { return Math.round(num); } num = Math.round(num * Math.pow(10, n)) / Math.pow(10, n); // 阅读全文
posted @ 2020-07-23 10:38 无序 阅读(167) 评论(0) 推荐(0)
摘要: <head> 标签区域加上 <meta name="referrer" content="no-referrer"> 阅读全文
posted @ 2020-05-09 11:21 无序 阅读(127) 评论(0) 推荐(0)
摘要: window.open('http://view.officeapps.live.com/op/view.aspx?src=' + file.url) 阅读全文
posted @ 2020-05-07 17:44 无序 阅读(1311) 评论(0) 推荐(0)
摘要: new Date(item.startTime.replace(/-/g, '/') dateFormat('hh:mm', new Date(item.startTime.replace(/-/g, '/'))) 阅读全文
posted @ 2020-04-15 15:03 无序 阅读(188) 评论(0) 推荐(0)
摘要: <script> function thousands(num){ var str = num.toString(); var reg = str.indexOf(".") > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g; return s 阅读全文
posted @ 2020-03-27 14:23 无序 阅读(6983) 评论(0) 推荐(1)
摘要: 项目中经常会遇到点击按钮复制订单号、订单id等内容到粘贴板中的需求。可是通常我们都是用Ctrl + c或右击复制的,别操心,js也是有复制命令的,那就是document.execCommand('copy'); 这个命令会将选中的内容复制到粘贴板中,那岂不是还需要选中?别急input和textare 阅读全文
posted @ 2020-03-26 16:53 无序 阅读(3055) 评论(0) 推荐(0)
摘要: Promise,我们了解到promise是ES6为解决异步回调而生,避免出现这种回调地狱,那么为何又需要Async/Await呢?你是不是和我一样对Async/Await感兴趣以及想知道如何使用,下面一起来看看这篇文章:Async/Await替代Promise的6个理由。 什么是Async/Awai 阅读全文
posted @ 2020-03-02 09:27 无序 阅读(699) 评论(0) 推荐(0)
摘要: Array.prototype.remove = function(val) { var index = this.indexOf(val); if (index > -1) { this.splice(index, 1); } }; function getNames(array,childs,a 阅读全文
posted @ 2020-01-13 08:50 无序 阅读(305) 评论(0) 推荐(0)
摘要: sandbox="allow-forms allow-scripts allow-same-origin allow-popups" 阅读全文
posted @ 2019-08-24 16:07 无序 阅读(1607) 评论(0) 推荐(0)