File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -65,5 +65,12 @@ export function componentFactory (
65
65
const Super = superProto instanceof Vue
66
66
? superProto . constructor as VueClass < Vue >
67
67
: Vue
68
- return Super . extend ( options )
68
+ const Extended = Super . extend ( options ) ;
69
+
70
+ for ( let staticKey in Component ) {
71
+ if ( Component . hasOwnProperty ( staticKey ) ) {
72
+ Extended [ staticKey ] = Component [ staticKey ] ;
73
+ }
74
+ }
75
+ return Extended ;
69
76
}
Original file line number Diff line number Diff line change @@ -274,4 +274,13 @@ describe('vue-class-component', () => {
274
274
const vm : any = new MyComp ( )
275
275
expect ( vm . test ) . to . equal ( 'foo' )
276
276
} )
277
+
278
+ it ( 'forwardStatics' , function ( ) {
279
+ @Component
280
+ class MyComp extends Vue {
281
+ static myValue = 52
282
+ }
283
+
284
+ expect ( MyComp . myValue ) . to . equal ( 52 ) ;
285
+ } )
277
286
} )
You can’t perform that action at this time.
0 commit comments