File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -268,20 +268,22 @@ module.exports = {
268268 */
269269
270270 build : function ( data , index , needCache ) {
271- var original = data
272271 var meta = { $index : index }
273272 if ( this . converted ) {
274- meta . $key = original . $key
273+ meta . $key = data . $key
275274 }
276275 var raw = this . converted ? data . $value : data
277276 var alias = this . arg
278- var hasAlias = ! isObject ( raw ) || ! isPlainObject ( data ) || alias
279- // wrap the raw data with alias
280- data = hasAlias ? { } : raw
281277 if ( alias ) {
278+ data = { }
282279 data [ alias ] = raw
283- } else if ( hasAlias ) {
280+ } else if ( ! isPlainObject ( raw ) ) {
281+ // non-object values
282+ data = { }
284283 meta . $value = raw
284+ } else {
285+ // default
286+ data = raw
285287 }
286288 // resolve constructor
287289 var Ctor = this . Ctor || this . resolveCtor ( data , meta )
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ if (_.inBrowser) {
256256 }
257257 } ,
258258 template : '<div v-repeat="listHash">{{$key}}' +
259- '<p v-repeat="$data ">{{a}}</p>' +
259+ '<p v-repeat="$value ">{{a}}</p>' +
260260 '</div>'
261261 } )
262262 function output ( key ) {
You can’t perform that action at this time.
0 commit comments