Browse Source

fix: 修复拖拽预览大小不一致问题

xyh 2 years ago
parent
commit
0ff210f80a
1 changed files with 2 additions and 3 deletions
  1. 2 3
      packages/app/src/components/table/HeaderTh.tsx

+ 2 - 3
packages/app/src/components/table/HeaderTh.tsx

@@ -39,7 +39,6 @@ const HeaderTh: FC<Props> = function({
   const isResizing = header.column.getIsResizing();
 
   const style: CSSProperties = {
-    width: `${header.column.getSize()}px`,
     cursor: isResizing ? 'col-resize' : disabledSort ? 'auto' : 'move',
     boxShadow: useDiv
       ? '0.5px 0.6px 12.3px rgba(0, 0, 0, 0.059),4px 5px 80px rgba(0, 0, 0, 0.1)'
@@ -50,7 +49,7 @@ const HeaderTh: FC<Props> = function({
     return (
       <div
         key={header.id}
-        style={{...style, backgroundColor: '#f5f5f5'}}
+        style={{...style, backgroundColor: '#f5f5f5', width: '100%'}}
         ref={setNodeRef}
         {...attributes}
         {...listeners}
@@ -68,7 +67,7 @@ const HeaderTh: FC<Props> = function({
   return (
     <th
       key={header.id}
-      style={{...style, ...fixedStyle}}
+      style={{...style, ...fixedStyle, width: `${header.column.getSize()}px`}}
       ref={setNodeRef}
       {...attributes}
       {...listeners}