javascript
菜鸟小营地
未来可期,愿初心不忘
展开
-
js获取当前日的前三天,除去周末
1.获取当前日期 currentData(){//当前日期 let date = new Date(); let year = date.getFullYear(); let month = date.getMonth()+1; let time = date.getDate(); month < 10? `0${month}` : month time < 10? `0${time}` :time return `${year}-${m原创 2020-06-16 10:23:59 · 794 阅读 · 0 评论 -
vue 前端本地存储搜索历史记录,删除某条记录,清空记录
vue 前端本地保存搜索历史,localStorage一、保存历史的数组是由元素组成: [ “000004 SZ”]在页面第一次加载的时候,从localStorage中获取历史记录created() { //获取localstorage let storage=window.localStorage; if(storage.getItem('searc...原创 2020-01-17 17:18:53 · 6032 阅读 · 0 评论 -
javascript 防抖节流
Javascript防抖和节流的深入理解和实践:http://www.ptbird.cn/javascript-anti-shake-throttle.htmlhttps://www.cnblogs.com/momo798/p/9177767.html原创 2019-05-15 15:41:06 · 109 阅读 · 0 评论 -
JavaScript -- this关键词
this关键词JavaScript this 关键词指的是它所属的对象。this 拥有不同的值,具体取决于它的使用位置:在方法中,this 指的是所有者对象。单独的情况下,this 指的是全局对象。在函数中,this 指的是全局对象。在函数中,严格模式下,this 是 undefined。在事件中,this 指的是接收事件的元素。1.方法中的this<p id="dem...原创 2019-07-18 16:28:31 · 226 阅读 · 0 评论