File tree Expand file tree Collapse file tree 11 files changed +40
-39
lines changed Expand file tree Collapse file tree 11 files changed +40
-39
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,12 @@ wechat:
1717 share_desc : 麻麻说:写代码一定要优雅
1818---
1919
20- <!-- more -->
21-
22- # Javascript 中的装饰器
23-
2420## 前言
2521
2622在 ES6 中增加了对类对象的相关定义和操作(比如 ` class ` 和 ` extends ` ),这就使得我们在多个不同类之间共享或者扩展一些方法或者行为的时候,变得并不是那么优雅。这个时候,我们就需要一种更优雅的方法来帮助我们完成这些事情。
2723
24+ <!-- more -->
25+
2826## Python 中的装饰器
2927
3028decorators 即 装饰器,这一特性的提出来源于 python 之类的语言,如果你熟悉 python 的话,对它一定不会陌生。那么我们先来看一下 python 里的装饰器是什么样子的吧:
Original file line number Diff line number Diff line change 1313 {{ header_menu (' main-nav' ) }}
1414 </ul>
1515 </nav>
16- <div class =" mod-search" >
16+ <div class =" mod-search" id= " J_search " >
1717 <a class =" fa fa-search mod-search-ico" id=" J_searchTrigger" title=" {{ __('menu.search') }}" ></a>
1818 <form id=" J_searchForm" method=" get" class =" mod-search-form" action=" /search/" >
1919 <input type=" text" name=" query" class =" mod-search-ipt" id=" J_searchInput" placeholder=" {{ __('menu.search') }}" />
Original file line number Diff line number Diff line change 11<!-- Post -->
22<article class =" post" >
3+ <div class =" post-cover" ><img src=" {{ post_img( post.cover|default(theme.post.cover) ) }}" alt=" {{ post.title }}" /></div>
34 <header class =" post-hd" >
45 {{seachData ()}}
5- <h2 class =" post-tit" >{{ post .title }}</h2 >
6+ <h1 class =" post-tit" >{{ post .title }}</h1 >
67 <div class =" post-meta" >
78 by <a target=" _blank" href=" https://github.com/{{ author.github_name }}" class =" post-author" >{{ author.nick |default (author.github_name ) }}</a> on <span>{{ date (post .date ) }}</span>
89 </div>
1112 {% endif %}
1213 <span style=" display:none;" id=" busuanzi_value_page_pv" ></span>
1314 </header>
14-
15- <div class =" post-cover" ><img src=" {{ post_img( post.cover|default(theme.post.cover) ) }}" alt=" {{ post.title }}" /></div>
16-
1715 <div class =" post-content" >
1816 {{ page_anchor (post .content ) }}
1917
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ the-transition() {
55}
66
77mobile () {
8- @media (max-width : 989 px ) {
8+ @media (max-width : 1023 px ) {
99 { block }
1010 }
1111}
@@ -17,7 +17,7 @@ mobile() {
1717// }
1818
1919desktop () {
20- @media (min-width : 990 px ) and (max-width : 1189 px ) {
20+ @media (min-width : 1014 px ) and (max-width : 1279 px ) {
2121 { block }
2222 }
2323}
Original file line number Diff line number Diff line change 22color-default = #64 64 64
33color-accent = #1a bc 9c
44color-grey = #9 9 9
5+ color-grey-lite = #e e e
56color-border = #d d d
67color-link = #3 3 3
78color-dark = #0 0 0
@@ -16,7 +17,6 @@ color-facebook = #3b5998
1617color-pinterest = #cb 20 27
1718color-google = #dd 4b 39
1819$color-theme = #61 90 e8
19- $gainsboro = #e e e
2020color-primary = $color-theme
2121
2222bg-primary = $color-theme
Original file line number Diff line number Diff line change 6666 width : 30px
6767 line-height : 30px
6868 text-align : center
69+ color : color-default
70+ & .active
71+ .mod-search-ico
72+ background : color-grey-lite
6973 & -form
7074 overflow :hidden
7175 opacity : 0
8286 box-sizing : border-box
8387 border : 1px solid #e e e
8488 background-color : #fc fc fc
89+ outline : none
8590 & :: -webkit- input -placeholder
8691 font-size : 14px
8792
8893 + mobile () {
8994 padding : 0 15px
95+ box-shadow : 0 1px 2px rgba (0 ,0 ,0 ,.1 )
9096 & -main {
9197 position : absolute
9298 top : 60px
Original file line number Diff line number Diff line change 1717 padding-top : 20px
1818 + mobile () {
1919 // background: #eaeaea
20+ padding-top : 1px
2021 }
2122
2223.mod-main
2324 float :left
2425 width : 930px
2526 margin-right : 20px
26- + mobile () {
27- float : none
28- margin-right : 0
29- width : 100%
30- }
3127 +desk to p-large() {
3228 width : 1230px
3329 }
3430 + desktop () {
3531 width : 730px
3632 }
37-
38- .mod-side
39- float : left
40- width : 240px
41- box-sizing : border-box
42- padding : 20px 15px
4333 + mobile () {
44- border-top : 1px solid #e e e
4534 float : none
35+ margin-right : 0
4636 width : 100%
4737 }
4838
Original file line number Diff line number Diff line change 11.mod-side
22 background : #f f f
3+ float : left
4+ width : 240px
5+ box-sizing : border-box
6+ padding : 20px 0 20px 15px
37 & -sec
48 margin-bottom : 30px
59 & :last-child
2226 & -bd
2327 padding : 10px 15px
2428 + mobile () {
29+ float : none
30+ width : 100%
2531 margin-top : 20px
2632 border-top : 1px solid #d d d
2733 }
5258 max-width : 224px
5359 margin : 0 auto 10px
5460 & -slogan
55- text-align : center
56-
57-
58-
59-
61+ text-align : center
Original file line number Diff line number Diff line change 5151 a
5252 color : $color-theme
5353 font-size : 14px
54- box-shadow : 0 1px 2px rgba (0 ,0 ,0 ,0.2 )
54+ box-shadow : 0 1px 2px rgba (0 ,0 ,0 ,0.1 )
5555
5656
Original file line number Diff line number Diff line change 66 word-wrap : break-word
77 & -hd
88 padding : 20px 0
9- h2
10- margin-bottom : 5px
11- color : #3 3 3
12- font-size : 28px
13- font-weight : 300
9+ & -tit
10+ margin-bottom : 5px
11+ color : #3 3 3
12+ // font-size: 28px
13+ font-weight : 300
1414 & -meta
1515 font-size : 12px
1616 overflow : hidden
4040 top : 0
4141
4242 & -cover
43- margin : 0 0 20px
43+ padding-top : 20px
4444 img
4545 display : block
46+ +mobile ()
47+ width : 100%
48+ +mobile ()
49+ padding-top : 0
4650
4751 & -revision
4852 font-size : 12px
7175 border-bottom : none
7276
7377 & -content
74- padding : 20px 0
78+ padding : 0 0 20px 0
7579 & a
7680 vertical-align : top
7781 & img
You can’t perform that action at this time.
0 commit comments