摘要: Array.prototype.myFilter = function(callback){ var newArr = [] for(var i = 0; i<this.length;i++){ if(callback(this[i], i)){ newArr.push(this[i]) } } r 阅读全文
posted @ 2021-08-11 10:37 有肌肉的小眼睛 阅读(34) 评论(0) 推荐(0)
摘要: Array.prototype.myMap = function(callback){ 注:这里的this 指向Array new出来的实例的this 即 arr的this var newArr = [] for(var i=0;i<this.length;i++){ newArr.push(cal 阅读全文
posted @ 2021-08-11 09:33 有肌肉的小眼睛 阅读(154) 评论(0) 推荐(0)
摘要: 反转数组: 1) 原生js for(var i = 0;i<arr.length/2;i++){ //借助第三方变量交换两个变量的值 var temp = arr[i]; arr[i] = arr[arr.length-1-i]; arr[arr.length-1-i] = temp; } 2) A 阅读全文
posted @ 2021-08-09 10:38 有肌肉的小眼睛 阅读(63) 评论(0) 推荐(0)
摘要: *{ margin:0; padding:0 } body, html, .body{ height:100%; width:100%; } .body{ display: flex; flex-direction: column; } .box1{ display: flex; justify-c 阅读全文
posted @ 2021-08-09 09:46 有肌肉的小眼睛 阅读(81) 评论(0) 推荐(0)
摘要: // 小程序更新代码 const updateManager = wx.getUpdateManager() updateManager.onCheckForUpdate(function (res) { // 请求完新版本信息的回调 console.log(res.hasUpdate) RealT 阅读全文
posted @ 2021-07-15 15:07 有肌肉的小眼睛 阅读(63) 评论(0) 推荐(0)
摘要: const accountInfo = wx.getAccountInfoSync(); console.log('监听小程序的版本号', accountInfo.miniProgram.version) // 小程序的版本号 阅读全文
posted @ 2021-07-15 15:05 有肌肉的小眼睛 阅读(178) 评论(0) 推荐(0)
摘要: function mySetInterVal(fn,a,b) { let timer={}; function setOneTimer(fn,a,b){ timer.id=setTimeout(()=>{ console.log(a); fn(); setOneTimer(fn,a+b,b); }, 阅读全文
posted @ 2021-06-11 17:33 有肌肉的小眼睛 阅读(159) 评论(0) 推荐(0)
摘要: 注:样式不太好看如有需要可行自己调节 1.checkbox template 2.checkbox script 3.checkbox style 4.checkbox-group template 5. checkbox-group script 6.使用 7.数据 checkArr:['艾琳', 阅读全文
posted @ 2021-06-09 17:12 有肌肉的小眼睛 阅读(346) 评论(0) 推荐(0)
摘要: 1.template 注:这里的z-icon标签是封装组件,可以直接替换为你想要的 icon 2、script 3.style 4.使用方法 5.传递的数据及接受到组件返回的数据 6.展示效果 阅读全文
posted @ 2021-06-09 16:59 有肌肉的小眼睛 阅读(370) 评论(0) 推荐(0)
摘要: 注:组件不太完善只能实现简单的功能 1.template模板 2.script 3.style 4.使用 5.展示效果 阅读全文
posted @ 2021-06-09 16:46 有肌肉的小眼睛 阅读(50) 评论(0) 推荐(0)