@@ -83,31 +83,36 @@ const TableRow = {
83
83
}
84
84
} ,
85
85
methods : {
86
- onRowClick ( event ) {
86
+ onRowClick ( event , rowPropFunc = noop ) {
87
87
const { record, index } = this ;
88
88
this . __emit ( 'rowClick' , record , index , event ) ;
89
+ rowPropFunc ( event ) ;
89
90
} ,
90
91
91
- onRowDoubleClick ( event ) {
92
+ onRowDoubleClick ( event , rowPropFunc = noop ) {
92
93
const { record, index } = this ;
93
94
this . __emit ( 'rowDoubleClick' , record , index , event ) ;
95
+ rowPropFunc ( event ) ;
94
96
} ,
95
97
96
- onContextMenu ( event ) {
98
+ onContextMenu ( event , rowPropFunc = noop ) {
97
99
const { record, index } = this ;
98
100
this . __emit ( 'rowContextmenu' , record , index , event ) ;
101
+ rowPropFunc ( event ) ;
99
102
} ,
100
103
101
- onMouseEnter ( event ) {
104
+ onMouseEnter ( event , rowPropFunc = noop ) {
102
105
const { record, index, rowKey } = this ;
103
106
this . __emit ( 'hover' , true , rowKey ) ;
104
107
this . __emit ( 'rowMouseenter' , record , index , event ) ;
108
+ rowPropFunc ( event ) ;
105
109
} ,
106
110
107
- onMouseLeave ( event ) {
111
+ onMouseLeave ( event , rowPropFunc = noop ) {
108
112
const { record, index, rowKey } = this ;
109
113
this . __emit ( 'hover' , false , rowKey ) ;
110
114
this . __emit ( 'rowMouseleave' , record , index , event ) ;
115
+ rowPropFunc ( event ) ;
111
116
} ,
112
117
113
118
setExpandedRowHeight ( ) {
@@ -241,15 +246,26 @@ const TableRow = {
241
246
customClassName ,
242
247
customClass ,
243
248
) ;
249
+ const rowPropEvents = rowProps . on || { } ;
244
250
const bodyRowProps = mergeProps (
245
251
{ ...rowProps , style } ,
246
252
{
247
253
on : {
248
- click : this . onRowClick ,
249
- dblclick : this . onRowDoubleClick ,
250
- mouseenter : this . onMouseEnter ,
251
- mouseleave : this . onMouseLeave ,
252
- contextmenu : this . onContextMenu ,
254
+ click : e => {
255
+ this . onRowClick ( e , rowPropEvents . click ) ;
256
+ } ,
257
+ dblclick : e => {
258
+ this . onRowDoubleClick ( e , rowPropEvents . dblclick ) ;
259
+ } ,
260
+ mouseenter : e => {
261
+ this . onMouseEnter ( e , rowPropEvents . mouseenter ) ;
262
+ } ,
263
+ mouseleave : e => {
264
+ this . onMouseLeave ( e , rowPropEvents . mouseleave ) ;
265
+ } ,
266
+ contextmenu : e => {
267
+ this . onContextMenu ( e , rowPropEvents . contextmenu ) ;
268
+ } ,
253
269
} ,
254
270
class : rowClassName ,
255
271
} ,
0 commit comments