File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
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 @@ -237,6 +237,24 @@ describe('Instance Events', function () {
237
237
expect ( vm . a ) . toBe ( 1 )
238
238
} )
239
239
240
+ it ( 'passing $arguments' , function ( ) {
241
+ new Vue ( {
242
+ el : document . createElement ( 'div' ) ,
243
+ template : '<comp @ready="onReady($arguments[1])"></comp>' ,
244
+ methods : {
245
+ onReady : spy
246
+ } ,
247
+ components : {
248
+ comp : {
249
+ compiled : function ( ) {
250
+ this . $emit ( 'ready' , 123 , 1234 )
251
+ }
252
+ }
253
+ }
254
+ } )
255
+ expect ( spy ) . toHaveBeenCalledWith ( 1234 )
256
+ } )
257
+
240
258
describe ( 'attached/detached' , function ( ) {
241
259
242
260
it ( 'in DOM' , function ( ) {
You can’t perform that action at this time.
0 commit comments