摘要: textarea内容可从后台读取或手动输入,常规输入后中文和数字会出现换行问题 <style> #textarea { display: block; margin: 0 auto; overflow: hidden; width: 250px; font-size: 14px; height: 1 阅读全文
posted @ 2019-03-20 14:48 ermao的博客 阅读(1019) 评论(0) 推荐(0) 编辑
摘要: 为什么很多人用 if...else..if 而不使用 switch 1,if...else...if 只是单纯地一个接一个比较;if...else可能每个条件都计算一遍; 2,switch 使用了Binary Tree算法;绝大部分情况下switch会快一点,除非是if-else的第一个条件就判断到 阅读全文
posted @ 2018-11-23 16:33 ermao的博客 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 在 vue 脚手架开发中,echarts图表自适应容器的方法: 父组件: <template> <div class="statistics_wrap"> <v-fir-grade ref="first"></v-fir-grade> </div> </template> <script> impo 阅读全文
posted @ 2018-11-22 10:49 ermao的博客 阅读(4213) 评论(0) 推荐(0) 编辑
摘要: 我们会发现,在很多post,put,delete等请求之前,会有一次options请求。 根本原因就是,W3C规范这样要求了!在跨域请求中,分为简单请求(get和部分post,post时content-type属于application/x-www-form-urlencoded,multipart 阅读全文
posted @ 2018-04-16 14:59 ermao的博客 阅读(17548) 评论(1) 推荐(4) 编辑
摘要: HTML: <div id="main">获取坐标</div> <div id="fixed_box"></div> <div id="main">获取坐标</div> <div id="fixed_box"></div> 1,jquery 获取鼠标坐标点 a ,获取当前鼠标相对html页面的原点的 阅读全文
posted @ 2018-01-09 11:27 ermao的博客 阅读(1358) 评论(0) 推荐(0) 编辑
摘要: 1、安装vue-resource到项目中,找到当前项目 输入:npm install vue-resource --save 2、安装完毕后,在main.js中导入,如下所示: import VueResource from 'vue-resource' Vue.use(VueResource) 3 阅读全文
posted @ 2017-12-29 14:24 ermao的博客 阅读(208) 评论(0) 推荐(0) 编辑
摘要: css代码之所以初始化,是因为能尽量减少 各浏览器之间的兼容性问题! 1,腾讯QQ官网 样式初始化 阅读全文
posted @ 2017-12-29 09:45 ermao的博客 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 2,使用ref 转载于 https://segmentfault.com/a/1190000009052002 阅读全文
posted @ 2017-11-29 13:48 ermao的博客 阅读(676) 评论(0) 推荐(0) 编辑
摘要: window.onload = function() { var oneClick = function() { alert("第一个事件"); }; var twoClick = function() { alert("第二个事件"); }; var threeClick = function() 阅读全文
posted @ 2017-08-31 16:15 ermao的博客 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 页面跳转,cookie存储参数 1,设置cookie function setCookie(name,value) { var Days = 30; var exp = new Date(); exp.setTime(exp.getTime() + Days*24*60*60*1000); docu 阅读全文
posted @ 2017-08-31 15:17 ermao的博客 阅读(221) 评论(0) 推荐(0) 编辑