diff --git a/src/component.ts b/src/component.ts index 0ec8652..f583ffd 100644 --- a/src/component.ts +++ b/src/component.ts @@ -65,5 +65,12 @@ export function componentFactory ( const Super = superProto instanceof Vue ? superProto.constructor as VueClass : Vue - return Super.extend(options) + const Extended = Super.extend(options); + + for(let staticKey in Component) { + if(Component.hasOwnProperty(staticKey)) { + Extended[staticKey] = Component[staticKey]; + } + } + return Extended; } diff --git a/test/test.ts b/test/test.ts index bb5a9c4..4d04dbb 100644 --- a/test/test.ts +++ b/test/test.ts @@ -274,4 +274,13 @@ describe('vue-class-component', () => { const vm: any = new MyComp() expect(vm.test).to.equal('foo') }) + + it('forwardStatics', function () { + @Component + class MyComp extends Vue { + static myValue = 52 + } + + expect(MyComp.myValue).to.equal(52); + }) })