@@ -104,7 +104,6 @@ export default defineComponent<CellProps>({
104
104
'transformCellText' ,
105
105
] as any ,
106
106
setup ( props , { slots } ) {
107
-
108
107
const hoverRef = ref ( null )
109
108
const contextSlots = useInjectSlots ( ) ;
110
109
const { onHover, startRow, endRow } = useInjectHover ( ) ;
@@ -122,6 +121,10 @@ export default defineComponent<CellProps>({
122
121
( props . additionalProps ?. rowspan as number )
123
122
) ;
124
123
} ) ;
124
+ const hovering = eagerComputed ( ( ) => {
125
+ const { index } = props ;
126
+ return inHoverRange ( index , rowSpan . value || 1 , startRow . value , endRow . value ) ;
127
+ } ) ;
125
128
const supportSticky = useInjectSticky ( ) ;
126
129
127
130
// ====================== Hover =======================
@@ -201,6 +204,7 @@ export default defineComponent<CellProps>({
201
204
renderIndex,
202
205
column : column . __originColumn__ ,
203
206
} ) ;
207
+
204
208
if ( isRenderCell ( renderData ) ) {
205
209
if ( process . env . NODE_ENV !== 'production' ) {
206
210
warning (
@@ -214,6 +218,7 @@ export default defineComponent<CellProps>({
214
218
childNode = renderData ;
215
219
}
216
220
}
221
+
217
222
if (
218
223
! ( INTERNAL_COL_DEFINE in column ) &&
219
224
cellType === 'body' &&
@@ -274,7 +279,6 @@ export default defineComponent<CellProps>({
274
279
} = cellProps || { } ;
275
280
const mergedColSpan = ( cellColSpan !== undefined ? cellColSpan : colSpan . value ) ?? 1 ;
276
281
const mergedRowSpan = ( cellRowSpan !== undefined ? cellRowSpan : rowSpan . value ) ?? 1 ;
277
-
278
282
if ( mergedColSpan === 0 || mergedRowSpan === 0 ) {
279
283
return null ;
280
284
}
@@ -299,6 +303,7 @@ export default defineComponent<CellProps>({
299
303
if ( align ) {
300
304
alignStyle . textAlign = align ;
301
305
}
306
+
302
307
// ====================== Render ======================
303
308
let title : string ;
304
309
const ellipsisConfig : CellEllipsisType = ellipsis === true ? { showTitle : true } : ellipsis ;
@@ -311,10 +316,6 @@ export default defineComponent<CellProps>({
311
316
}
312
317
313
318
// AddEventListener Hover
314
- const hovering = eagerComputed ( ( ) => {
315
- const { index } = props ;
316
- return inHoverRange ( index , rowSpan . value || 1 , startRow . value , endRow . value ) ;
317
- } ) ;
318
319
watch ( [ rowSpan , startRow , endRow ] , ( ) => {
319
320
hoverRef . value ?. setAttribute ( "class" , classNames (
320
321
cellPrefixCls ,
@@ -338,7 +339,7 @@ export default defineComponent<CellProps>({
338
339
[ `${ cellPrefixCls } -fix-sticky` ] :
339
340
( isFixLeft || isFixRight ) && isSticky && supportSticky . value ,
340
341
}
341
-
342
+
342
343
const componentProps = {
343
344
title,
344
345
...restCellProps ,
@@ -357,6 +358,7 @@ export default defineComponent<CellProps>({
357
358
onMouseleave,
358
359
style : [ additionalProps . style , alignStyle , fixedStyle , cellStyle ] ,
359
360
} ;
361
+
360
362
return (
361
363
< Component { ...componentProps } ref = { hoverRef } >
362
364
{ appendNode }
0 commit comments