File tree 3 files changed +55
-0
lines changed
3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export interface TableProps<RecordType = DefaultRecordType>
106
106
sorter : SorterResult < RecordType > | SorterResult < RecordType > [ ] ,
107
107
extra : TableCurrentDataSource < RecordType > ,
108
108
) => void ;
109
+ onResizeColumn ?: ( w : number , col : ColumnType ) => void ;
109
110
rowSelection ?: TableRowSelection < RecordType > ;
110
111
111
112
getPopupContainer ?: GetPopupContainer ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import genRadiusStyle from './radius';
13
13
import genRtlStyle from './rtl' ;
14
14
import genSelectionStyle from './selection' ;
15
15
import genSizeStyle from './size' ;
16
+ import genResizeStyle from './resize' ;
16
17
import genSorterStyle from './sorter' ;
17
18
import genStickyStyle from './sticky' ;
18
19
import genSummaryStyle from './summary' ;
@@ -404,6 +405,7 @@ export default genComponentStyleHook('Table', token => {
404
405
genStickyStyle ( tableToken ) ,
405
406
genEllipsisStyle ( tableToken ) ,
406
407
genSizeStyle ( tableToken ) ,
408
+ genResizeStyle ( tableToken ) ,
407
409
genRtlStyle ( tableToken ) ,
408
410
] ;
409
411
} ) ;
Original file line number Diff line number Diff line change
1
+ // 此样式是vue版本独有样式,react版本没有拖拽改变列宽度功能
2
+ import type { CSSObject } from '../../_util/cssinjs' ;
3
+ import type { GenerateStyle } from '../../theme/internal' ;
4
+ import type { TableToken } from './index' ;
5
+
6
+ const genResizeStyle : GenerateStyle < TableToken , CSSObject > = token => {
7
+ const { componentCls } = token ;
8
+
9
+ return {
10
+ [ `${ componentCls } -wrapper ${ componentCls } -resize-handle` ] : {
11
+ position : 'absolute' ,
12
+ top : 0 ,
13
+ height : '100% !important' ,
14
+ bottom : 0 ,
15
+ left : ' auto !important' ,
16
+ right : ' -8px' ,
17
+ cursor : 'col-resize' ,
18
+ touchAction : 'none' ,
19
+ userSelect : 'auto' ,
20
+ width : '16px' ,
21
+ zIndex : 1 ,
22
+ [ `&-line` ] : {
23
+ display : 'block' ,
24
+ width : '1px' ,
25
+ marginLeft : '7px' ,
26
+ height : '100% !important' ,
27
+ backgroundColor : token . colorPrimary ,
28
+ opacity : 0 ,
29
+ } ,
30
+ [ `&:hover &-line` ] : {
31
+ opacity : 1 ,
32
+ } ,
33
+ } ,
34
+ [ `${ componentCls } -wrapper ${ componentCls } -resize-handle.dragging` ] : {
35
+ overflow : 'hidden' ,
36
+ [ `${ componentCls } -resize-handle-line` ] : {
37
+ opacity : 1 ,
38
+ } ,
39
+ [ `&:before` ] : {
40
+ position : 'absolute' ,
41
+ top : 0 ,
42
+ bottom : 0 ,
43
+ content : '" "' ,
44
+ width : '200vw' ,
45
+ transform : 'translateX(-50%)' ,
46
+ opacity : 0 ,
47
+ } ,
48
+ } ,
49
+ } ;
50
+ } ;
51
+
52
+ export default genResizeStyle ;
You can’t perform that action at this time.
0 commit comments