Decorative image frame

一点儿都不慌

、、、

一点儿都不慌

继承

原型链继承

1
2
3
4
5
6
7
8
9
10
11
12
function Parent() {
this.name = '原型链继承'
}
Parent.prototype.getName = function(){
console.log(this.name)
}
function Child(){

}
Child.prototype = new Parent()
var child = new Child();
child.getName()

缺点
1 引用类型的属性会被所有的实例共享
2 在创建Child实例时,不能向Parent传参

阅读全文...

小程序&&Taro记录

  • Taro 扫码进入页面传递多个参数会被截断
1
2
3
4
5
// url: '/index?scene=id=1&aa=2'
// 实测android不会自动转码 = 号后面会被截断 ios不会
console.log ( this.$router.params.scene )
// android id
// ios id=1&aa=2
阅读全文...