base64转图片
摘要:var imgurl = data; if (imgurl.indexOf("base64") != -1) { imgurl = data; } else if (imgurl.indexOf("data:image/jpeg;base64") == -1) { imgurl = "data:im
阅读全文
posted @
2020-03-27 11:32
chenlw101
阅读(786)
推荐(0) 编辑
7.attribute与property
摘要:<ul> <li class="liclass" >11111</li> <li class="liclass">2222</li> <li>3333</li> <li>44444</li> <li>555555</li> </ul> const lilist = document.querySel
阅读全文
posted @
2020-03-26 10:53
chenlw101
阅读(152)
推荐(0) 编辑
6.手写实现bind,call,apply
摘要://bind Function.prototype.bind1 = function(){ let args = Array.prototype.slice.call(arguments); let t = args.shift(); let self = this; return function
阅读全文
posted @
2020-03-21 14:54
chenlw101
阅读(305)
推荐(0) 编辑
5.this
摘要:function fn1(){ console.log(this) } fn1();//window fn1.call({x:100});//{x:100} const fn2 = fn1.bind({x:200}) fn2();//{x:200} const zhangsan = { name:'
阅读全文
posted @
2020-03-20 16:53
chenlw101
阅读(74)
推荐(0) 编辑
4.闭包
摘要:// 闭包:自由变量的查找,是在函数定义的地方,向上级作用域查找 , 不是在执行的地方!!! // 函数作为返回值 function create(){ let a =100; return function(){ console.log(a) } } const fn = create(); co
阅读全文
posted @
2020-03-20 16:41
chenlw101
阅读(89)
推荐(0) 编辑
3.原型与原型链
摘要:通过hasOwnProperty('name') 来查看是否是自己的属性 1.原型 // class实际上是函数,可见是语法糖 typeof Student //"function" typeof People //"function" // 隐式原型 和 显示原型 console.log(aaa.
阅读全文
posted @
2020-03-19 18:35
chenlw101
阅读(140)
推荐(0) 编辑
2.class、继承、instanceof
摘要:// 父类 class People{ constructor(name){ this.name = name; } eat(){ console.log(`姓名 ${this.name} eat something `) } } // 子类 class Student extends People
阅读全文
posted @
2020-03-19 17:39
chenlw101
阅读(203)
推荐(0) 编辑
1.数据类型、typeof、深拷贝、变量计算
摘要:1.数据类型:值类型(Number,String,Boolean,undefined),引用类型(object(包含数组),Null),函数 2.typeod 判断所有的值类型,函数。引用类型无法区分(都是object) 3.深拷贝 3.深拷贝 const obj1 = { age:20, name
阅读全文
posted @
2020-03-19 16:45
chenlw101
阅读(154)
推荐(0) 编辑
vue深度监视
摘要:stus:[{name:'jack}] watch:{ stus:{ deep:true,//深度监听 handler:function(newv,oldv){ console.log(newv[0]['name']) } } }
阅读全文
posted @
2020-03-17 10:35
chenlw101
阅读(300)
推荐(0) 编辑
服务器安装node
摘要://找个文件夹放置下载的node cd /usr/local/ //下载node wget https://npm.taobao.org/mirrors/node/v10.13.0/node-v10.13.0-linux-x64.tar.xz //解压 tar -xvf node-v10.13.0-
阅读全文
posted @
2020-03-13 16:22
chenlw101
阅读(164)
推荐(0) 编辑
服务器php环境搭建与apache
摘要:Apache安装 yum install httpd 启动 systemctl start httpd.service #启动 systemctl stop httpd.service #停止 systemctl restart httpd.service #重启 第二、设置开机启动/关闭 syst
阅读全文
posted @
2020-03-12 09:07
chenlw101
阅读(423)
推荐(0) 编辑
php分割字符串转为数组,数组添加元素
摘要:$a = "1-300";$b = explode("-",$a);print_r($b); $a=array("red","green"); array_push($a,"blue","yellow"); print_r($a);
阅读全文
posted @
2020-03-11 18:38
chenlw101
阅读(525)
推荐(0) 编辑