摘要:
<swiper auto direction="vertical" :interval=2000 class="text-scroll" :show-dots="false"> <swiper-item><p>义务爱了 完成传奇世界H5-王者归来任务 获得20金币</p></swiper-item> 阅读全文
摘要:
防抖 按钮频繁被点击,同一个接口在某个时间段内多次被访问,比如搜索。防抖的目的是,触发事件后,在固定时间之后调用事件。如果在设置时间以内,再次触发事件,就清除定时器,重新开始计时。直至固定时间内没有再次触发事件,才去执行设置的函数。 let timer = null Vue.prototype.de 阅读全文
摘要:
downloadVideo(){ let link = "https://xx.mp4" let fileName = 'xx.mp4' var x = new XMLHttpRequest(); x.open("GET", link, true); x.responseType = 'blob'; 阅读全文
摘要:
window.addEventListener('scroll',throttle(handleScroll,100)); let throttle_func = null throttle(func,delay){ var context = this return function(){ var 阅读全文
摘要:
作者:Jaskey Lam链接:https://www.zhihu.com/question/20543196/answer/57757836来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 1.不知道自己高度和父容器高度的情况下, 利用绝对定位只需要以下三行: par 阅读全文
摘要:
<div class="ex" id="ex">三行的高度,三行的高度,三行的高度,三行的高度,三行的高度,三行的高度,三行的高度</div> mounted: function (){ //页面中直接调用 this.getElementHeight('#ex') //组件中调用,我也不知道为什么要 阅读全文
摘要:
<div class="recom_view"> <div class="recom"> 1 </div> <div class="recom"> 2 </div> <div class="recom"> 3 </div> <div><style>.recom_view{ column-count: 阅读全文
摘要:
在router-view 中加入 key 就好了,因为在路由页面存在页面缓存。<router-view :key="this.$route.path"></router-view> 阅读全文
摘要:
用小程序提供的wx.miniProgram.getEnv可以获取环境参数 阅读全文