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 @@ -11,7 +11,13 @@ module.exports = {
11
11
// support "item in items" syntax
12
12
var inMatch = this . expression . match ( / ( .* ) i n ( .* ) / )
13
13
if ( inMatch ) {
14
- this . alias = inMatch [ 1 ]
14
+ var itMatch = inMatch [ 1 ] . match ( / \( ( .* ) , ( .* ) \) / )
15
+ if ( itMatch ) {
16
+ this . iterator = itMatch [ 1 ]
17
+ this . alias = itMatch [ 2 ]
18
+ } else {
19
+ this . alias = inMatch [ 1 ]
20
+ }
15
21
this . expression = inMatch [ 2 ]
16
22
}
17
23
@@ -207,6 +213,9 @@ module.exports = {
207
213
// avoid accidental fallback
208
214
_ . define ( scope , '$key' , null )
209
215
}
216
+ if ( this . iterator ) {
217
+ _ . defineReactive ( scope , this . iterator , key || index )
218
+ }
210
219
var frag = this . factory . create ( host , scope , this . _frag )
211
220
frag . forId = this . id
212
221
this . cacheFrag ( value , frag , index , key )
You can’t perform that action at this time.
0 commit comments