- 博客(8)
- 收藏
- 关注
原创 js上传图片压缩
private afterFront(file){ console.log(2, file) let file_mb = file.content.length / (1024.0 * 1024); console.log(2, file_mb); let img = new Image(); ...
2020-03-21 01:13:53
134
原创 html2canvas在ios里报跨域的解决方法
1、网图转base64this.getBase64Image(this.sharePoster, "coopCachetImg"); // 第一个参数是图片的URL地址,第二个是转换成base64地址后要赋值给的img标签 getBase64Image(url, ref) { var that = this; var image = new Image(); ...
2020-03-21 01:04:47
965
原创 js奇技淫巧
1、typeof 判断属性typeof 37 === 'number'; truetypeof "bla" === 'string'; trueinstanceof 新方法 要提前定义 更准确var oStringObject = new String("hello world"); console.log(oStringObject inst...
2019-03-19 14:52:09
668
转载 promise
promise .then为异步执行,先执行上一个程序不等服务器返回.then执行下一个,这样就避免了,数据没获取到等的问题。1、.then(aaa) aaa的值为上一个函数return的值,若没有return,则默认undefined 3、若上一个.then返回不是函数,则取上上个.then返回的函数4、第四个方法与第一个相似,直接.then取上一个的值...
2018-12-11 15:25:11
89
原创 vue备忘录(转盘活动)
1、aaa.init.init初始化function init(){var TestStrA = "abc";var TestStrB = "def";var TestStrC = TestStrA + TestStrB;alert(TestStrC);}2、function myFunction(){ var node=document.createEle...
2018-12-10 11:52:46
552
原创 angular6踩坑记
1、ts里route跳转 import { Router} from '@angular/router';public router: Router,this.router.navigate(['/project/pm'],{queryParams:{'unique_no':unique_no});页面A页面<a [routerLink]="['../aaa...
2018-11-05 23:12:39
1799
原创 promise,async与setTimeout的优先级script start
async function async1(){console.log("async1 start");await async2();console.log("async1 end");}async function async2(){console.log('async2');}console.log("script start");setTimeout(fu...
2018-07-30 11:17:03
771
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人