@@ -83,31 +83,36 @@ const TableRow = {
8383 }
8484 } ,
8585 methods : {
86- onRowClick ( event ) {
86+ onRowClick ( event , rowPropFunc = noop ) {
8787 const { record, index } = this ;
8888 this . __emit ( 'rowClick' , record , index , event ) ;
89+ rowPropFunc ( event ) ;
8990 } ,
9091
91- onRowDoubleClick ( event ) {
92+ onRowDoubleClick ( event , rowPropFunc = noop ) {
9293 const { record, index } = this ;
9394 this . __emit ( 'rowDoubleClick' , record , index , event ) ;
95+ rowPropFunc ( event ) ;
9496 } ,
9597
96- onContextMenu ( event ) {
98+ onContextMenu ( event , rowPropFunc = noop ) {
9799 const { record, index } = this ;
98100 this . __emit ( 'rowContextmenu' , record , index , event ) ;
101+ rowPropFunc ( event ) ;
99102 } ,
100103
101- onMouseEnter ( event ) {
104+ onMouseEnter ( event , rowPropFunc = noop ) {
102105 const { record, index, rowKey } = this ;
103106 this . __emit ( 'hover' , true , rowKey ) ;
104107 this . __emit ( 'rowMouseenter' , record , index , event ) ;
108+ rowPropFunc ( event ) ;
105109 } ,
106110
107- onMouseLeave ( event ) {
111+ onMouseLeave ( event , rowPropFunc = noop ) {
108112 const { record, index, rowKey } = this ;
109113 this . __emit ( 'hover' , false , rowKey ) ;
110114 this . __emit ( 'rowMouseleave' , record , index , event ) ;
115+ rowPropFunc ( event ) ;
111116 } ,
112117
113118 setExpandedRowHeight ( ) {
@@ -241,15 +246,26 @@ const TableRow = {
241246 customClassName ,
242247 customClass ,
243248 ) ;
249+ const rowPropEvents = rowProps . on || { } ;
244250 const bodyRowProps = mergeProps (
245251 { ...rowProps , style } ,
246252 {
247253 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+ } ,
253269 } ,
254270 class : rowClassName ,
255271 } ,
0 commit comments