File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 11import Watcher from '../../watcher'
2- import { del } from '../../util/index'
2+ import { del , toArray } from '../../util/index'
33import { parseText } from '../../parsers/text'
44import { parseDirective } from '../../parsers/directive'
55import { getPath } from '../../parsers/path'
@@ -23,7 +23,9 @@ export default function (Vue) {
2323 if ( asStatement && ! isSimplePath ( exp ) ) {
2424 var self = this
2525 return function statementHandler ( ) {
26+ self . $arguments = toArray ( arguments )
2627 res . get . call ( self , self )
28+ self . $arguments = null
2729 }
2830 } else {
2931 try {
Original file line number Diff line number Diff line change @@ -32,18 +32,13 @@ export default function (Vue) {
3232
3333 function registerComponentEvents ( vm , el ) {
3434 var attrs = el . attributes
35+ var name , handler
3536 for ( var i = 0 , l = attrs . length ; i < l ; i ++ ) {
36- let name = attrs [ i ] . name
37+ name = attrs [ i ] . name
3738 if ( eventRE . test ( name ) ) {
3839 name = name . replace ( eventRE , '' )
39- const scope = vm . _scope || vm . _context
40- const handler = scope . $eval ( attrs [ i ] . value , true )
41- vm . $on ( name . replace ( eventRE ) , function ( ...args ) {
42- scope . $arguments = args
43- const result = handler . apply ( this , args )
44- scope . $arguments = null
45- return result
46- } )
40+ handler = ( vm . _scope || vm . _context ) . $eval ( attrs [ i ] . value , true )
41+ vm . $on ( name . replace ( eventRE ) , handler )
4742 }
4843 }
4944 }
You can’t perform that action at this time.
0 commit comments