File tree Expand file tree Collapse file tree 7 files changed +11
-12
lines changed Expand file tree Collapse file tree 7 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,8 @@ val counts = database.staffs
96
96
97
97
如果 data class 真的那么完美的话,Ktorm 在最初设计的时候就不会决定使用 ` Entity ` interface 了。事实上,即使在 2.5 版本发布以后,使用 interface 定义实体类仍然是我们的第一选择。与使用 interface 定义实体类相比,使用 data class 目前还存在如下两个限制:
98
98
99
- - ** 无法使用列绑定功能: ** 由于直接以 ` BaseTable ` 作为父类,我们无法在定义表对象时使用 ` bindTo ` 、` references ` 等函数指定数据库列与实体类属性的绑定关系,因此每个表对象都必须实现 ` doCreateEntity ` 函数,在此函数中手动创建实体对象,并一一对各个属性赋值。
100
- - ** 无法使用实体对象的增删改 API: ** 由于使用 data class 作为实体类,Ktorm 无法对其进行代理,因此无法检测到实体对象的状态变化,这导致 ` sequence.add(..) ` 、` entity.flushChanges() ` 等针对实体对象的增删改 API 将无法使用。但是 SQL DSL 并没有影响,我们仍然可以使用 ` database.insert(..) {..} ` 、` database.update(..) {..} ` 等 DSL 函数进行增删改操作。
99
+ - ** 无法使用列绑定功能** : 由于直接以 ` BaseTable ` 作为父类,我们无法在定义表对象时使用 ` bindTo ` 、` references ` 等函数指定数据库列与实体类属性的绑定关系,因此每个表对象都必须实现 ` doCreateEntity ` 函数,在此函数中手动创建实体对象,并一一对各个属性赋值。
100
+ - ** 无法使用实体对象的增删改 API** : 由于使用 data class 作为实体类,Ktorm 无法对其进行代理,因此无法检测到实体对象的状态变化,这导致 ` sequence.add(..) ` 、` entity.flushChanges() ` 等针对实体对象的增删改 API 将无法使用。但是 SQL DSL 并没有影响,我们仍然可以使用 ` database.insert(..) {..} ` 、` database.update(..) {..} ` 等 DSL 函数进行增删改操作。
101
101
102
102
由于以上限制的存在,在你决定使用 data class 作为实体类之前,应该慎重考虑,你获得了使用 data class 的好处,同时也会失去其他的东西。请记住这句话:** 使用 interface 定义实体类仍然是我们的第一选择。**
103
103
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class Sidebar extends React.Component {
28
28
}
29
29
30
30
componentDidUpdate ( ) {
31
- if ( $ ( window ) . width ( ) > 800 ) {
31
+ if ( $ ( window ) . width ( ) >= 800 ) {
32
32
setTimeout ( function ( ) {
33
33
const $sidebar = $ ( '.doc-sidebar' ) ;
34
34
const $firstItem = $ ( $ ( '.doc-sidebar-list' ) . children ( '.doc-sidebar-list__item--link' ) . get ( 0 ) ) ;
Original file line number Diff line number Diff line change 22
22
overflow : auto ;
23
23
padding-top : 0 ;
24
24
25
- @media screen and (max-width : $doc-breakpoint ) {
25
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
26
26
padding-top : 0.8rem ;
27
27
}
28
28
}
29
29
30
- @media screen and (max-width : $doc-breakpoint ) {
30
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
31
31
transform : translateX (0 );
32
32
margin-right : 0 ;
33
33
}
Original file line number Diff line number Diff line change 4
4
display : flex ;
5
5
6
6
.lang-switcher {
7
- @media screen and (max-width : $doc-breakpoint ) {
7
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
8
8
display : none
9
9
}
10
10
}
Original file line number Diff line number Diff line change 38
38
}
39
39
40
40
& .doc-sidebar--is-visible {
41
- @media screen and (max-width : $doc-breakpoint ) {
41
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
42
42
.doc-sidebar {
43
43
transform : translateX (0 );
44
44
z-index : 9 ;
Original file line number Diff line number Diff line change 31
31
height : 100% ;
32
32
align-items : center ;
33
33
34
- @media screen and (max-width : $doc-breakpoint ) {
34
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
35
35
flex-grow : initial ;
36
36
}
37
37
}
53
53
margin-left : 12px ;
54
54
vertical-align : text-bottom ;
55
55
56
- @media screen and (max-width : $doc-breakpoint ) {
56
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
57
57
display : none
58
58
}
59
59
}
82
82
vertical-align : middle ;
83
83
}
84
84
85
- @media screen and (max-width : $doc-breakpoint ) {
85
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
86
86
display : none
87
87
}
88
88
}
117
117
-webkit-overflow-scrolling : touch ;
118
118
z-index : 2 ;
119
119
120
- @media screen and (max-width : $doc-breakpoint ) {
120
+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
121
121
transform : translateX (- $doc-sidebar-width );
122
122
border-right : 1px solid #e1e1e1 ;
123
123
}
Original file line number Diff line number Diff line change 1
1
// breakpoints
2
2
// -----------
3
3
$doc-breakpoint : 800px !default ;
4
- $doc-breakpoint-small : 480px !default ;
5
4
6
5
// colors
7
6
// -------------
You can’t perform that action at this time.
0 commit comments