File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -65,5 +65,12 @@ export function componentFactory (
6565 const Super = superProto instanceof Vue
6666 ? superProto . constructor as VueClass < Vue >
6767 : 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 ;
6976}
Original file line number Diff line number Diff line change @@ -274,4 +274,13 @@ describe('vue-class-component', () => {
274274 const vm : any = new MyComp ( )
275275 expect ( vm . test ) . to . equal ( 'foo' )
276276 } )
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+ } )
277286} )
You can’t perform that action at this time.
0 commit comments