File tree 2 files changed +23
-1
lines changed
test/unit/specs/directives
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ module.exports = {
268
268
}
269
269
var raw = this . converted ? data . value : data
270
270
var alias = this . arg
271
- var hasAlias = ! isPlainObject ( raw ) || alias
271
+ var hasAlias = ! isObject ( raw ) || ! isPlainObject ( data ) || alias
272
272
// wrap the raw data with alias
273
273
data = hasAlias ? { } : raw
274
274
if ( alias ) {
Original file line number Diff line number Diff line change @@ -194,6 +194,28 @@ if (_.inBrowser) {
194
194
)
195
195
} )
196
196
197
+ it ( 'nested repeats on object' , function ( ) {
198
+ var vm = new Vue ( {
199
+ el : el ,
200
+ data : {
201
+ listHash : {
202
+ listA : [ { a : 1 } , { a : 2 } ] ,
203
+ listB : [ { a : 1 } , { a : 2 } ]
204
+ }
205
+ } ,
206
+ template : '<div v-repeat="listHash">{{$key}}' +
207
+ '<p v-repeat="$data">{{a}}</p>' +
208
+ '</div>'
209
+ } )
210
+ function output ( key ) {
211
+ var key1 = key === 'listA' ? 'listB' : 'listA'
212
+ return '<div>' + key + '<p>1</p><p>2</p><!--v-repeat--></div>' +
213
+ '<div>' + key1 + '<p>1</p><p>2</p><!--v-repeat--></div>' +
214
+ '<!--v-repeat-->'
215
+ }
216
+ expect ( el . innerHTML === output ( 'listA' ) || el . innerHTML === output ( 'listB' ) ) . toBeTruthy ( )
217
+ } )
218
+
197
219
it ( 'dynamic component type based on instance data' , function ( ) {
198
220
var vm = new Vue ( {
199
221
el : el ,
You can’t perform that action at this time.
0 commit comments