Skip to content

Commit 6828a5d

Browse files
committed
tie statics to constructor
1 parent a87d94a commit 6828a5d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/mixin.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@ function defineSubscribedProperty(vm, key, obj){
2626
}
2727

2828
function defineStaticProperty(vm, key, obj){
29-
const ss = vm.$statics;
30-
const cid = vm.constructor.cid;
31-
if(!ss[cid]){
32-
vm.$set(ss, cid, {});
33-
}
34-
if(!hasProp(ss[cid], key)){
35-
vm.$set(ss[cid], key, obj[key]);
29+
const cc = vm.constructor;
30+
if(!hasProp(cc, key)){
31+
vm.$set(cc, key, obj[key]);
3632
}
3733
Object.defineProperty(vm, key,{
38-
get:()=>ss[cid][key],
39-
set:(newValue)=> {vm.$set(ss[cid], key, newValue);}
34+
get:()=> cc[key],
35+
set:(newValue)=> {vm.$set(cc, key, newValue);}
4036
});
4137
}
4238

0 commit comments

Comments
 (0)