会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
James的博客园
博客园
首页
新随笔
联系
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
31
下一页
2020年8月5日
ES6 +
摘要: => ES8 2017 '1'.padStart(2, '*') // '*1''1'.padEnd(2, '*') // '1*''1'.padStart(6, '*#') // '*#*#*1' => ES8 2017 let obj = {name: 'james', age: 22, sex
阅读全文
posted @ 2020-08-05 23:16 James2019
阅读(107)
评论(0)
推荐(0)
2020年8月1日
egg.js 文件上传
摘要: 以下是官方文件上传文档 https://github.com/eggjs/egg-multipart https://eggjs.org/zh-cn/plugins/multipart.html .
阅读全文
posted @ 2020-08-01 23:30 James2019
阅读(2079)
评论(0)
推荐(0)
2020年7月28日
JS 正则截取字符串
摘要: 1、js截取两个字符串之间的内容: varstr = "aaabbbcccdddeeefff"; str = str.match(/aaa(\S*)fff/)[1]; console.log(str);//结果bbbcccdddeee 2、js截取某个字符串前面的内容: varstr = "aaa/
阅读全文
posted @ 2020-07-28 07:43 James2019
阅读(5950)
评论(0)
推荐(0)
2020年7月25日
定时任务 cron 学习
摘要: cron的表达式被用来配置CronTrigger实例。 cron的表达式是字符串,实际上是由七子表达式,描述个别细节的时间表。这些子表达式是分开的空白,代表: 1. Seconds 2. Minutes 3. Hours 4. Day-of-Month 5. Month 6. Day-of-Week
阅读全文
posted @ 2020-07-25 07:05 James2019
阅读(293)
评论(0)
推荐(0)
2020年7月15日
用console 控制台操作网页事件
摘要: 打开浏览器控制台: var js = window.document.createElement('script'); js.setAttribute('src', 'https://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js'); js.
阅读全文
posted @ 2020-07-15 13:54 James2019
阅读(1117)
评论(0)
推荐(0)
2020年7月9日
symbol
摘要: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Symbol https://www.jianshu.com/p/fd76d308b742
阅读全文
posted @ 2020-07-09 16:51 James2019
阅读(209)
评论(0)
推荐(0)
2020年7月8日
ES6+
摘要: 参数默认值 function decimal(num, fix = 2) { return +num.toFixed(fix); } 模板字符串 解构赋值 // 函数入参默认值解构function example({x, y, z = 0}) { return x + y + z; } consol
阅读全文
posted @ 2020-07-08 13:25 James2019
阅读(127)
评论(0)
推荐(0)
2020年7月1日
前端性能优化
摘要: gzip压缩原理 https://segmentfault.com/a/1190000012571492?utm_source=tag-newest //关闭 webpack 的性能提示 https://blog.csdn.net/yun_hou/article/details/87818475 /
阅读全文
posted @ 2020-07-01 16:42 James2019
阅读(151)
评论(0)
推荐(0)
2020年5月27日
ES6结合正则判断js数据类型
摘要: ES5:(有重复,所以判断数组或对象等,就会有问题) typeof 1 > 'number' typeof 'hello' > 'string' typeof alert > 'function' typeof [1,2,3] > 'object' typeof {a:1,b:2} > 'objec
阅读全文
posted @ 2020-05-27 11:37 James2019
阅读(590)
评论(0)
推荐(0)
2020年4月13日
canvas 绘制的文字如何换行?
摘要: drawText("Hello, World!What a nice day.",0,30,110); function drawText(t,x,y,w){ var chr = t.split(""); var temp = ""; var row = []; context.font = "20
阅读全文
posted @ 2020-04-13 14:31 James2019
阅读(1395)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
31
下一页
公告