File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ function guardComponents (options) {
231
231
}
232
232
def = components [ key ]
233
233
if ( _ . isPlainObject ( def ) ) {
234
- def . id = def . id || key
234
+ def . name = def . name || key
235
235
components [ key ] = def . _Ctor || ( def . _Ctor = _ . Vue . extend ( def ) )
236
236
}
237
237
}
@@ -280,10 +280,10 @@ function guardArrayAssets (assets) {
280
280
var asset
281
281
while ( i -- ) {
282
282
asset = assets [ i ]
283
- var id = asset . id || ( asset . options && asset . options . id )
283
+ var id = asset . name || ( asset . options && asset . options . name )
284
284
if ( ! id ) {
285
285
process . env . NODE_ENV !== 'production' && _ . warn (
286
- 'Array-syntax assets must provide an id field.'
286
+ 'Array-syntax assets must provide a "name" field.'
287
287
)
288
288
} else {
289
289
res [ id ] = asset
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ describe('Util - Option merging', function () {
123
123
}
124
124
} )
125
125
expect ( typeof res . components . test ) . toBe ( 'function' )
126
- expect ( res . components . test . options . id ) . toBe ( 'test' )
126
+ expect ( res . components . test . options . name ) . toBe ( 'test' )
127
127
expect ( res . components . test . super ) . toBe ( Vue )
128
128
} )
129
129
@@ -282,11 +282,12 @@ describe('Util - Option merging', function () {
282
282
}
283
283
}
284
284
var b = {
285
- components : [ { id : 'b' } ]
285
+ components : [ { name : 'b' } ]
286
286
}
287
287
var res = merge ( a , b )
288
288
expect ( res . components . a ) . toBe ( a . components . a )
289
289
// b.components is guarded and converted to object hash
290
+ expect ( res . components . b ) . toBeTruthy ( )
290
291
expect ( res . components . b ) . toBe ( b . components . b )
291
292
} )
292
293
@@ -300,7 +301,7 @@ describe('Util - Option merging', function () {
300
301
components : [ { } ]
301
302
}
302
303
merge ( a , b )
303
- expect ( hasWarned ( _ , 'must provide an id ' ) ) . toBe ( true )
304
+ expect ( hasWarned ( _ , 'must provide a "name" field ' ) ) . toBe ( true )
304
305
} )
305
306
306
307
} )
You can’t perform that action at this time.
0 commit comments