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
9696
9797如果 data class 真的那么完美的话,Ktorm 在最初设计的时候就不会决定使用 ` Entity ` interface 了。事实上,即使在 2.5 版本发布以后,使用 interface 定义实体类仍然是我们的第一选择。与使用 interface 定义实体类相比,使用 data class 目前还存在如下两个限制:
9898
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 函数进行增删改操作。
101101
102102由于以上限制的存在,在你决定使用 data class 作为实体类之前,应该慎重考虑,你获得了使用 data class 的好处,同时也会失去其他的东西。请记住这句话:** 使用 interface 定义实体类仍然是我们的第一选择。**
103103
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class Sidebar extends React.Component {
2828 }
2929
3030 componentDidUpdate ( ) {
31- if ( $ ( window ) . width ( ) > 800 ) {
31+ if ( $ ( window ) . width ( ) >= 800 ) {
3232 setTimeout ( function ( ) {
3333 const $sidebar = $ ( '.doc-sidebar' ) ;
3434 const $firstItem = $ ( $ ( '.doc-sidebar-list' ) . children ( '.doc-sidebar-list__item--link' ) . get ( 0 ) ) ;
Original file line number Diff line number Diff line change 2222 overflow : auto ;
2323 padding-top : 0 ;
2424
25- @media screen and (max-width : $doc-breakpoint ) {
25+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
2626 padding-top : 0.8rem ;
2727 }
2828 }
2929
30- @media screen and (max-width : $doc-breakpoint ) {
30+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
3131 transform : translateX (0 );
3232 margin-right : 0 ;
3333 }
Original file line number Diff line number Diff line change 44 display : flex ;
55
66 .lang-switcher {
7- @media screen and (max-width : $doc-breakpoint ) {
7+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
88 display : none
99 }
1010 }
Original file line number Diff line number Diff line change 3838 }
3939
4040 & .doc-sidebar--is-visible {
41- @media screen and (max-width : $doc-breakpoint ) {
41+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
4242 .doc-sidebar {
4343 transform : translateX (0 );
4444 z-index : 9 ;
Original file line number Diff line number Diff line change 3131 height : 100% ;
3232 align-items : center ;
3333
34- @media screen and (max-width : $doc-breakpoint ) {
34+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
3535 flex-grow : initial ;
3636 }
3737 }
5353 margin-left : 12px ;
5454 vertical-align : text-bottom ;
5555
56- @media screen and (max-width : $doc-breakpoint ) {
56+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
5757 display : none
5858 }
5959 }
8282 vertical-align : middle ;
8383 }
8484
85- @media screen and (max-width : $doc-breakpoint ) {
85+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
8686 display : none
8787 }
8888 }
117117 -webkit-overflow-scrolling : touch ;
118118 z-index : 2 ;
119119
120- @media screen and (max-width : $doc-breakpoint ) {
120+ @media screen and (max-width : calc ( $doc-breakpoint - 1 px ) ) {
121121 transform : translateX (- $doc-sidebar-width );
122122 border-right : 1px solid #e1e1e1 ;
123123 }
Original file line number Diff line number Diff line change 11// breakpoints
22// -----------
33$doc-breakpoint : 800px !default ;
4- $doc-breakpoint-small : 480px !default ;
54
65// colors
76// -------------
You can’t perform that action at this time.
0 commit comments