-
Notifications
You must be signed in to change notification settings - Fork 434
Statics #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Statics #146
Changes from 3 commits
73f4e4c
e4d22fd
b23216b
a242026
e192193
8d21dd2
aed78f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,5 +64,10 @@ export function componentFactory ( | |
const Super = superProto instanceof Vue | ||
? superProto.constructor as VueClass | ||
: Vue | ||
return Super.extend(options) | ||
const rv = Super.extend(options); | ||
|
||
for(let sttc in Component) | ||
if(!(sttc in function() {}) && Component.hasOwnProperty(sttc)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Written like that, a child class doesn't forward the statics of its parent. I am not sure of the question, therefore I don't know if it answers - what do you mean by "impact component inheritance" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider @Compoent class Parent extends Vue { static config = {} }
@Compoent class Child extends Parent {}
Child.config // expect an object {}
I think you already understand me. And I even suspect whether we should support inheritance any way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep it simple. vue-class-component is for both Babel and TS users. Rolling out a babel compatible version might be challenging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, is it still a "change requested" or an acceptation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is this necessary? Looks like only using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will for instance avoid statics to override There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why shouldn't they be overridden? Is that stated in the spec? |
||
rv[sttc] = Component[sttc]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we rename |
||
return rv; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add curly braces for
for
andif
expressions?