File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,15 @@ export default {
2727 __emit ( ) {
2828 // 直接调用listeners,底层组件不需要vueTool记录events
2929 const args = [ ] . slice . call ( arguments , 0 ) ;
30- const filterEvent = [ ] ;
3130 const eventName = args [ 0 ] ;
32- if ( args . length && this . $listeners [ eventName ] ) {
33- if ( filterEvent . includes ( eventName ) ) {
34- this . $emit ( eventName , ...args . slice ( 1 ) ) ;
31+ const event = this . $listeners [ eventName ] ;
32+ if ( args . length && event ) {
33+ if ( Array . isArray ( event ) ) {
34+ for ( let i = 0 , l = event . length ; i < l ; i ++ ) {
35+ event [ i ] ( ...args . slice ( 1 ) ) ;
36+ }
3537 } else {
36- this . $listeners [ eventName ] ( ...args . slice ( 1 ) ) ;
38+ event ( ...args . slice ( 1 ) ) ;
3739 }
3840 }
3941 } ,
Original file line number Diff line number Diff line change @@ -232,14 +232,22 @@ export default {
232232 let firstChildren = children [ 0 ] ;
233233 if ( this . prop && this . autoLink && isValidElement ( firstChildren ) ) {
234234 const originalEvents = getEvents ( firstChildren ) ;
235+ const originalBlur = originalEvents . blur ;
236+ const originalChange = originalEvents . change ;
235237 firstChildren = cloneElement ( firstChildren , {
236238 on : {
237239 blur : ( ...args ) => {
238- originalEvents . blur && originalEvents . blur ( ...args ) ;
240+ originalBlur && originalBlur ( ...args ) ;
239241 this . onFieldBlur ( ) ;
240242 } ,
241243 change : ( ...args ) => {
242- originalEvents . change && originalEvents . change ( ...args ) ;
244+ if ( Array . isArray ( originalChange ) ) {
245+ for ( let i = 0 , l = originalChange . length ; i < l ; i ++ ) {
246+ originalChange [ i ] ( ...args ) ;
247+ }
248+ } else if ( originalChange ) {
249+ originalChange ( ...args ) ;
250+ }
243251 this . onFieldChange ( ) ;
244252 } ,
245253 } ,
Original file line number Diff line number Diff line change 211211 " lib/**/style/*" ,
212212 " *.less"
213213 ]
214- }
214+ }
You can’t perform that action at this time.
0 commit comments