File tree 2 files changed +6
-7
lines changed
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { getOptionProps } from './props-util' ;
2
- import { isOn } from './util' ;
3
2
4
3
export default {
5
4
methods : {
@@ -25,13 +24,10 @@ export default {
25
24
} ) ;
26
25
} ,
27
26
__emit ( ) {
28
- // 直接调用listeners ,底层组件不需要vueTool记录events
27
+ // 直接调用事件 ,底层组件不需要vueTool记录events
29
28
const args = [ ] . slice . call ( arguments , 0 ) ;
30
29
let eventName = args [ 0 ] ;
31
- // TODO: 后续统一改成onXxxx,不在运行时转,提升性能
32
- eventName = isOn ( eventName )
33
- ? eventName
34
- : `on${ eventName [ 0 ] . toUpperCase ( ) } ${ eventName . substring ( 1 ) } ` ;
30
+ eventName = `on${ eventName [ 0 ] . toUpperCase ( ) } ${ eventName . substring ( 1 ) } ` ;
35
31
const event = this . $props [ eventName ] || this . $attrs [ eventName ] ;
36
32
if ( args . length && event ) {
37
33
if ( Array . isArray ( event ) ) {
Original file line number Diff line number Diff line change @@ -568,7 +568,10 @@ export default {
568
568
if ( this . childOriginEvents [ type ] ) {
569
569
this . childOriginEvents [ type ] ( e ) ;
570
570
}
571
- this . __emit ( type , e ) ;
571
+ const event = this . $props [ type ] || this . $attrs [ type ] ;
572
+ if ( event ) {
573
+ event ( e ) ;
574
+ }
572
575
} ,
573
576
574
577
close ( ) {
You can’t perform that action at this time.
0 commit comments