File tree 2 files changed +14
-0
lines changed
test/unit/specs/directives/internal
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,11 @@ function guardArrayAssets (assets) {
325
325
export function mergeOptions ( parent , child , vm ) {
326
326
guardComponents ( child )
327
327
guardProps ( child )
328
+ if ( process . env . NODE_ENV !== 'production' ) {
329
+ if ( child . propsData && ! vm ) {
330
+ warn ( 'propsData can only be used as an instantiation option.' )
331
+ }
332
+ }
328
333
var options = { }
329
334
var key
330
335
if ( child . mixins ) {
Original file line number Diff line number Diff line change @@ -615,6 +615,15 @@ describe('prop', function () {
615
615
expect ( vm . a ) . toBe ( 123 )
616
616
} )
617
617
618
+ it ( 'should warn using propsData during extension' , function ( ) {
619
+ Vue . extend ( {
620
+ propsData : {
621
+ a : 123
622
+ }
623
+ } )
624
+ expect ( 'propsData can only be used as an instantiation option' ) . toHaveBeenWarned ( )
625
+ } )
626
+
618
627
it ( 'should not warn for non-required, absent prop' , function ( ) {
619
628
new Vue ( {
620
629
el : el ,
You can’t perform that action at this time.
0 commit comments