摘要: 1、求数组最大/小值 const arr=[0,1,2,3,4] const prim = Math.min/max(...arr)// min:0 max:4 2、数组快速去重 let arr = [3, 5, 2, 2, 5, 5]; let unique = [...new Set(arr)] 阅读全文
posted @ 2021-11-11 14:13 携手度余生 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 1、数据延迟及渲染延迟 nextTick(dom全部渲染完成后执行,通常用与延迟加载) mounted(){ this.init() //先加载 this.$nextTick(()=>{ this.afterInit() //后加载 }) } 2、setTimeout(多长时间后执行) mounte 阅读全文
posted @ 2021-11-11 11:59 携手度余生 阅读(46) 评论(0) 推荐(0) 编辑