摘要: function deepClone(obj) { if(obj == null) return var newObj = Array.isArray(obj) ? [] : {} for(let key in obj) { if(obj.hasOwnProperty(key)) { // obj对 阅读全文
posted @ 2021-12-10 15:56 有肌肉的小眼睛 阅读(79) 评论(0) 推荐(0)
摘要: <!--html--> <div id="box"> <div class="contentBox"><div id="content">幸运观众是</div></div> <div class="btnBox"> <button class='btnStyle' id="start">开始</bu 阅读全文
posted @ 2021-12-10 14:33 有肌肉的小眼睛 阅读(333) 评论(0) 推荐(0)
摘要: methods: { handleScroll() { //可滚动容器的高度 if(!document.querySelector("容器的类名")){ return false } let innerHeight = document.querySelector("容器的类名").clientHe 阅读全文
posted @ 2021-12-08 17:47 有肌肉的小眼睛 阅读(188) 评论(0) 推荐(0)
摘要: vue2: <template> <keep-alive> <router-view></router-view> </keep-alive></template> vue3:<template> <router-view v-slot={Component}> <keep-alive> <comp 阅读全文
posted @ 2021-12-08 16:33 有肌肉的小眼睛 阅读(452) 评论(0) 推荐(0)
摘要: Array.prototype.myFind = function(fn) { for(let i=0;i<this.length;i++) { if(fn(this[i])) return this[i] }} let arr = [1,2,3,4,5,6] let targetNum = arr 阅读全文
posted @ 2021-12-07 09:50 有肌肉的小眼睛 阅读(600) 评论(0) 推荐(0)
摘要: let arr = [1,[2,3],[4,5],6]let newArr = []Array.prototype.myFlat = function() { for(let i=0;i<this.length;i++){ if(Array.isArray(this[i])){ this[i].my 阅读全文
posted @ 2021-12-07 09:47 有肌肉的小眼睛 阅读(98) 评论(0) 推荐(0)
摘要: 第一种: 1、git remote add origin git@gitlab.com:xxxxx/xxxx项目.git //将本地仓库和远程仓库进行关联 2、执行 git add 和 git commit 将修改的内容项目同步到本地仓库 3、git push --set-upstream orig 阅读全文
posted @ 2021-11-03 14:37 有肌肉的小眼睛 阅读(117) 评论(0) 推荐(0)
摘要: getYMDHMS (timestamp) { let time = new Date(timestamp) let year = time.getFullYear() let month = time.getMonth() + 1 let date = time.getDate() let hou 阅读全文
posted @ 2021-09-26 21:50 有肌肉的小眼睛 阅读(2231) 评论(0) 推荐(0)
摘要: //localStorage.js const sessionStore = { setlocalStorage(key, value){ if(typeof(value) == 'object'){ if(value == null){ //给出相应的提示就行 }else{ localStorag 阅读全文
posted @ 2021-08-27 15:52 有肌肉的小眼睛 阅读(55) 评论(0) 推荐(0)
摘要: var arr = [1,5,6,2,4,9,3]for(var i=0;i<arr.length-1;i++){ for(var j=0;j<arr.length-i-1;j++){ if(arr[j]>arr[j+1]){ [arr[j],arr[j+1]] = [arr[j+1],arr[j] 阅读全文
posted @ 2021-08-12 13:05 有肌肉的小眼睛 阅读(26) 评论(0) 推荐(0)