File tree 2 files changed +9
-7
lines changed
test/unit/specs/directives
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -268,20 +268,22 @@ module.exports = {
268
268
*/
269
269
270
270
build : function ( data , index , needCache ) {
271
- var original = data
272
271
var meta = { $index : index }
273
272
if ( this . converted ) {
274
- meta . $key = original . $key
273
+ meta . $key = data . $key
275
274
}
276
275
var raw = this . converted ? data . $value : data
277
276
var alias = this . arg
278
- var hasAlias = ! isObject ( raw ) || ! isPlainObject ( data ) || alias
279
- // wrap the raw data with alias
280
- data = hasAlias ? { } : raw
281
277
if ( alias ) {
278
+ data = { }
282
279
data [ alias ] = raw
283
- } else if ( hasAlias ) {
280
+ } else if ( ! isPlainObject ( raw ) ) {
281
+ // non-object values
282
+ data = { }
284
283
meta . $value = raw
284
+ } else {
285
+ // default
286
+ data = raw
285
287
}
286
288
// resolve constructor
287
289
var Ctor = this . Ctor || this . resolveCtor ( data , meta )
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ if (_.inBrowser) {
256
256
}
257
257
} ,
258
258
template : '<div v-repeat="listHash">{{$key}}' +
259
- '<p v-repeat="$data ">{{a}}</p>' +
259
+ '<p v-repeat="$value ">{{a}}</p>' +
260
260
'</div>'
261
261
} )
262
262
function output ( key ) {
You can’t perform that action at this time.
0 commit comments