摘要:
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); // 阅读全文
摘要:
<head> 标签区域加上 <meta name="referrer" content="no-referrer"> 阅读全文
摘要:
window.open('http://view.officeapps.live.com/op/view.aspx?src=' + file.url) 阅读全文
摘要:
new Date(item.startTime.replace(/-/g, '/') dateFormat('hh:mm', new Date(item.startTime.replace(/-/g, '/'))) 阅读全文
摘要:
<script> function thousands(num){ var str = num.toString(); var reg = str.indexOf(".") > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g; return s 阅读全文
摘要:
项目中经常会遇到点击按钮复制订单号、订单id等内容到粘贴板中的需求。可是通常我们都是用Ctrl + c或右击复制的,别操心,js也是有复制命令的,那就是document.execCommand('copy'); 这个命令会将选中的内容复制到粘贴板中,那岂不是还需要选中?别急input和textare 阅读全文
摘要:
Promise,我们了解到promise是ES6为解决异步回调而生,避免出现这种回调地狱,那么为何又需要Async/Await呢?你是不是和我一样对Async/Await感兴趣以及想知道如何使用,下面一起来看看这篇文章:Async/Await替代Promise的6个理由。 什么是Async/Awai 阅读全文
摘要:
Array.prototype.remove = function(val) { var index = this.indexOf(val); if (index > -1) { this.splice(index, 1); } }; function getNames(array,childs,a 阅读全文
摘要:
sandbox="allow-forms allow-scripts allow-same-origin allow-popups" 阅读全文
摘要:
{ "git.ignoreMissingGitWarning": true, "editor.multiCursorModifier": "ctrlCmd", "editor.snippetSuggestions": "top", "editor.formatOnPaste": false, "fi 阅读全文