1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-28 21:32:20 +00:00

Merge branch 'gh-pages' of github.com:ruanyf/es6tutorial into gh-pages

This commit is contained in:
ruanyf 2016-05-20 07:58:30 +08:00
commit c41e6261f4
2 changed files with 14 additions and 15 deletions

View File

@ -2,14 +2,14 @@
/* Small screens (default) */ /* Small screens (default) */
html { font-size: 100%; } html { font-size: 100%; }
/* Medium screens (640px) */ /* Medium screens (640px) */
@media (min-width: 40rem) { @media (min-width: 40rem) {
html { font-size: 112%; } html { font-size: 112%; }
} }
/* Large screens (1024px) */ /* Large screens (1024px) */
@media (min-width: 64rem) { @media (min-width: 64rem) {
html { font-size: 120%; } html { font-size: 120%; }
} }
@ -139,7 +139,7 @@ input.searchButton {
/* border: 1px solid black; */ /* border: 1px solid black; */
counter-reset: section; counter-reset: section;
} }
@media (min-width: 40rem) { @media (min-width: 40rem) {
@ -166,9 +166,6 @@ input.searchButton {
} }
#content code { #content code {
padding-left: 3px;
padding-right: 3px;
color: #a6e22e; color: #a6e22e;
font-size: 0.7rem; font-size: 0.7rem;
font-weight: normal; font-weight: normal;
@ -178,10 +175,12 @@ input.searchButton {
border-radius: 2px; border-radius: 2px;
} }
#content p>code, #content p code,
#content li>code, #content li>code,
#content h2>code, #content h2>code,
#content h3>code{ #content h3>code{
padding-left: 3px;
padding-right: 3px;
color: #c7254e; color: #c7254e;
background: #f9f2f4; background: #f9f2f4;
} }
@ -361,7 +360,7 @@ input.searchButton {
margin-left: 560px; margin-left: 560px;
font-size: 14px; font-size: 14px;
} }
} }
#flip{ #flip{

View File

@ -521,7 +521,7 @@ co函数返回一个Promise对象因此可以用then方法添加回调函数
```javascript ```javascript
co(gen).then(function (){ co(gen).then(function (){
console.log('Generator 函数执行完成'); console.log('Generator 函数执行完成');
}) });
``` ```
上面代码中等到Generator函数执行结束就会输出一行提示。 上面代码中等到Generator函数执行结束就会输出一行提示。
@ -575,7 +575,7 @@ g.next().value.then(function(data){
g.next(data).value.then(function(data){ g.next(data).value.then(function(data){
g.next(data); g.next(data);
}); });
}) });
``` ```
手动执行其实就是用then方法层层添加回调函数。理解了这一点就可以写出一个自动执行器。 手动执行其实就是用then方法层层添加回调函数。理解了这一点就可以写出一个自动执行器。
@ -886,7 +886,7 @@ async function foo() {}
const foo = async function () {}; const foo = async function () {};
// 对象的方法 // 对象的方法
let obj = { async foo() {} } let obj = { async foo() {} };
// 箭头函数 // 箭头函数
const foo = async () => {}; const foo = async () => {};
@ -1023,7 +1023,7 @@ function chainAnimationsPromise(elem, animations) {
p = p.then(function(val) { p = p.then(function(val) {
ret = val; ret = val;
return anim(elem); return anim(elem);
}) });
} }
// 返回一个部署了错误捕捉机制的Promise // 返回一个部署了错误捕捉机制的Promise
@ -1052,7 +1052,7 @@ function chainAnimationsGenerator(elem, animations) {
} catch(e) { } catch(e) {
/* 忽略错误,继续执行 */ /* 忽略错误,继续执行 */
} }
return ret; return ret;
}); });
} }