javaScript
文章平均质量分 54
镜花幻影空意摇
这个作者很懒,什么都没留下…
展开
-
启动dist文件serve
原创 2022-02-15 13:53:49 · 1175 阅读 · 0 评论 -
vue项目单击事件双击事件同时存在
data中 timer: null, onceClick() { let timers = this.timer; if (timers) { window.clearTimeout(timers); this.timer = null; } else { this.timer = window.setTimeout(() => { console.log("我是单击事件");原创 2021-03-31 11:41:58 · 837 阅读 · 0 评论 -
前端面试知识零散内容整理
1.谈谈你对 dns-prefetch 的理解DNS 是什么-- Domain Name System,域名系统,作为域名和IP地址相互映射的一个分布式数据库。使用方式<link rel="dns-prefetch" href="//wq.test.com">这个功能有个默认加载条件,所有的a标签的href都会自动去启用DNS Prefetching,也就是说,你网页的a标签href带的域名,是不需要在head里面加上link手动设置的。但a标签的默认启动在HTTPS不起作用。这时要原创 2021-03-01 16:54:00 · 184 阅读 · 0 评论 -
js面试题整理
process.nextTick(NodeJs), Promise, Object.observe(已废弃), MutationObserver(html5新特性)。:script(整体代码), setTimeout, setInterval, setImmediate(NodeJs), I/O, UI rendering。浏览器会将promise callbacks加入到同步事件队列的末尾,而不是异步事件的队列。解法一:重写toPrimitive,valueOf,toString。原创 2021-02-23 16:38:35 · 72 阅读 · 0 评论 -
文件流方式下载excel
一、请求方法中加入{responseType: ‘arraybuffer’},或{responseType: ‘blod’}export function fileDownload(url, params) { return new Promise((resolve, reject) => { axios.post(url, params,{responseType: 'arraybuffer'}) .then(response => {原创 2020-09-14 13:50:41 · 749 阅读 · 0 评论 -
call,apply,bind
let arr=[34,78,99,33,21]let max=Math.max.applay(Math,arr)o={ name:"andy"}function fn(a,b){ console.log(this) console.log(a,b)}let f=fn.bind(o,1,2)f();call,apply(数组),bind(返回新函数)如果有的函数我们不需要立即调用,但是又想改变这个函数内部的this指向此时用bind...原创 2020-06-03 22:14:01 · 76 阅读 · 0 评论 -
移动端键盘弹出底部按钮隐藏
data() { return { wxShow:true, domHeight: document.documentElement.clientHeight, //默认屏幕高度 showHeight: document.documentElement.clientHeight, //实时屏幕高度 }; },mounted(){ window.onresize = (原创 2020-05-15 14:14:46 · 198 阅读 · 0 评论 -
点击鼠标出现小心心
<script> // 点击出现小心心 !function(e, t, a) { function r() { for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[...原创 2020-03-18 22:21:23 · 395 阅读 · 0 评论 -
监听滚动条,滚动到底部加载下一页
vue中监听滚动条,滚动到底部加载下一页data中数据clientHeight:0,//可视区的高度scrollTop:0,//滚动条滚动时,距离顶部的距离scrollHeight:0,//滚动条的总高度listenerFunction(){ this.scrollTop = document.documentElement.scrollTop || document.body.s...原创 2020-03-18 22:10:58 · 988 阅读 · 0 评论 -
js判断GPS是否开启
handleNotice(e){ let system = uni.getSystemInfoSync();// 获取系统信息 console.log("获取系统信息",JSON.stringify(system)); if (system.platform === 'android') { // 判断平台 var context = plus.android.importClass("...原创 2020-03-12 17:04:29 · 943 阅读 · 0 评论 -
uniapp相关问题
async submit(){ this.form.imgs=await this.uploads() this.$api.http.post('/add_record',this.form).then(res=>{ }) }, //小...原创 2020-03-13 09:32:54 · 120 阅读 · 0 评论 -
miniui相关问题
miniui表格操作中相关问题//*****操作*****function onActionRenderer(e) { var grid = e.sender; var record = e.record; var uid = record._uid; var state=e.row.gender; //流程状态 1:保存,其他:处理中 var...原创 2020-03-05 21:50:40 · 362 阅读 · 0 评论 -
文档片段对象
如果父元素已经在页面上了,要添加多个平级子元素应先将平级子元素添加到文档片段对象中最后,再一次性将文档片段对象添加到DOM树结果: 浏览器也只重绘一次创建文档片段:var frag=document.createDocumentFragment();创建 文档 片段将子元素添加到文档片段中frag.appendChild(child)将整个文档片段添加到DOM树父元...原创 2019-08-07 17:10:03 · 335 阅读 · 0 评论 -
关于百度生成器定位图标不显示
百度生成器网址http://api.map.baidu.com/lbsapi/creatmap/生成地图后不显示定位图标找到代码中的icon地址http://app.baidu.com/map/images/us_mk_icon.png替换成http://api.map.baidu.com/lbsapi/creatmap/images/us_mk_icon.png即可...原创 2019-08-05 15:58:25 · 196 阅读 · 0 评论 -
vue中商品详情页放大镜功能
templates中内容< div class=“productLeft”><!- 左侧中图 -->< div class=“mdImg”>< img :src=“require(’…/assets/imgs/details/’+mdImgUrl)” alt=""></ div><!- 遮罩层 -->< d...原创 2019-07-26 12:28:59 · 2485 阅读 · 0 评论 -
vue中利用v-show写的轮播
//template中内容<div class="carousel"> <!--轮播图片--> <div class="carouselImgs"> <ul> <li @mouseover="over" @mouseleave="out" v-for="(item,index) o...原创 2019-07-26 12:15:59 · 262 阅读 · 0 评论 -
jquery轮播
<style> *{margin:0;padding:0;} #banner{ width:1200px; margin:0 auto; overflow: hidden; position:relative; } #ul-imgs{ overflow: hi...原创 2019-07-26 19:07:31 · 76 阅读 · 0 评论