File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,13 @@ module.exports = {
14
14
// support "item in items" syntax
15
15
var inMatch = this . expression . match ( / ( .* ) i n ( .* ) / )
16
16
if ( inMatch ) {
17
- this . alias = inMatch [ 1 ]
17
+ var itMatch = inMatch [ 1 ] . match ( / \( ( .* ) , ( .* ) \) / )
18
+ if ( itMatch ) {
19
+ this . iterator = itMatch [ 1 ]
20
+ this . alias = itMatch [ 2 ]
21
+ } else {
22
+ this . alias = inMatch [ 1 ]
23
+ }
18
24
this . _watcherExp = inMatch [ 2 ]
19
25
}
20
26
@@ -215,6 +221,9 @@ module.exports = {
215
221
// avoid accidental fallback
216
222
_ . define ( scope , '$key' , null )
217
223
}
224
+ if ( this . iterator ) {
225
+ _ . defineReactive ( scope , this . iterator , key || index )
226
+ }
218
227
var frag = this . factory . create ( host , scope , this . _frag )
219
228
frag . forId = this . id
220
229
this . cacheFrag ( value , frag , index , key )
You can’t perform that action at this time.
0 commit comments