Eva's Blog

进一寸有一寸的欢喜


  • Home

  • Archives

  • Movies

  • About

  • Tags

「 微信开发 」微信分享功能

Posted on 2018-09-28 | Comments:

实践微信的分享功能

Read more »

「 微信开发 」小程序的入口

Posted on 2018-09-22 | Comments:

用户在使用微信时,打开小程序的体验要比打开H5页面的体验要好得多,老板希望在H5页面可以直接打开小程序。

查阅资料发现,至目前为止,现在H5和小程序互相跳转的唯二方式如下:

Read more »

「 微信开发 」前言

Posted on 2018-09-18 | Comments:

现在经济不景气,小公司拿不到投资,连iOS开发和andriod开发都招不起,而微信凭借着众多的用户,成为了开发的热土,一个创业公司可以没有App,但一定会需要先在微信里试水,是公司获客的最佳渠道。

这个系列记录了微信开发遇到的问题,和产品狗相爱相杀的往事。

Read more »

JS中的面向对象5-Object.create和new Object

Posted on 2018-07-18 | Comments:
1
2
3
4
5
6
var Person = function(age) {
this.age=age;
this.say=function(){console.log('hello');}
};
var p=new Person(11);
var p1 = Object.create(p);

从console中可以发现,p成了p1的原型对象,p中的属性和方法都成了p1的原型方法。

Object.create的作用就是传入一个对象,给创建的新对象提供__proto__引用

多用在对象的继承中。

Object.create的实现方式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if (!Object.create) {
Object.create = function(proto, propertiesObject) {
if (typeof proto !== 'object' && typeof proto !== 'function') {
throw new TypeError('Object prototype may only be an Object:' + proto);
} else if (proto === null) {
throw new Error("This browser's implementation of Object.create is a shim and doesn't support 'null'");
}
if (typeof propertiesObject != 'undefined') {
throw new Error("This browser's implementation of Object.create is a shim and doesn't support a second argument");
}

function F() {};
F.prototype = proto;
return new F();
}
}

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create

JS中的面向对象4-继承的实现

Posted on 2018-07-15 | Comments:

理解了基本发展历史和深层原理,接下来就是生生不息的原因,继承部分啦。

Read more »

1…567…9
Eva

Eva

Focus on Front-end Develop

45 posts
16 tags
RSS
GitHub E-Mail
© 2015 – 2019 Eva