File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Expand file tree Collapse file tree 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>
106106 sorter : SorterResult < RecordType > | SorterResult < RecordType > [ ] ,
107107 extra : TableCurrentDataSource < RecordType > ,
108108 ) => void ;
109+ onResizeColumn ?: ( w : number , col : ColumnType ) => void ;
109110 rowSelection ?: TableRowSelection < RecordType > ;
110111
111112 getPopupContainer ?: GetPopupContainer ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import genRadiusStyle from './radius';
1313import genRtlStyle from './rtl' ;
1414import genSelectionStyle from './selection' ;
1515import genSizeStyle from './size' ;
16+ import genResizeStyle from './resize' ;
1617import genSorterStyle from './sorter' ;
1718import genStickyStyle from './sticky' ;
1819import genSummaryStyle from './summary' ;
@@ -404,6 +405,7 @@ export default genComponentStyleHook('Table', token => {
404405 genStickyStyle ( tableToken ) ,
405406 genEllipsisStyle ( tableToken ) ,
406407 genSizeStyle ( tableToken ) ,
408+ genResizeStyle ( tableToken ) ,
407409 genRtlStyle ( tableToken ) ,
408410 ] ;
409411} ) ;
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