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 1
1
import Watcher from '../../watcher'
2
- import { del } from '../../util/index'
2
+ import { del , toArray } from '../../util/index'
3
3
import { parseText } from '../../parsers/text'
4
4
import { parseDirective } from '../../parsers/directive'
5
5
import { getPath } from '../../parsers/path'
@@ -23,7 +23,9 @@ export default function (Vue) {
23
23
if ( asStatement && ! isSimplePath ( exp ) ) {
24
24
var self = this
25
25
return function statementHandler ( ) {
26
+ self . $arguments = toArray ( arguments )
26
27
res . get . call ( self , self )
28
+ self . $arguments = null
27
29
}
28
30
} else {
29
31
try {
Original file line number Diff line number Diff line change @@ -32,18 +32,13 @@ export default function (Vue) {
32
32
33
33
function registerComponentEvents ( vm , el ) {
34
34
var attrs = el . attributes
35
+ var name , handler
35
36
for ( var i = 0 , l = attrs . length ; i < l ; i ++ ) {
36
- let name = attrs [ i ] . name
37
+ name = attrs [ i ] . name
37
38
if ( eventRE . test ( name ) ) {
38
39
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 )
47
42
}
48
43
}
49
44
}
You can’t perform that action at this time.
0 commit comments