-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
super() in a method overriden via Vue.extend #2977
Comments
|
Hi @softomatix - I wrote vue-super, which might be helpful. |
Sorry, to keep answering into a closed thread :-( I really like to known more about why Vue are not using ES6 classes, besides "I don't want to endorse deep class inheritance". I agree that "deep inheritance" is not a god thing to encourage, but that is not a really good argument for not using ES6 classes more directly. Some times ago, You wrote something about static properties that would be a problem in native classes, what else could be a problem, and could there be found a solution ? Would it be possible to have a Vue.extend type and ES6 class in parallel, to make a more natural integration to both ES6 and Typescript ? As I wrote before, this is the single most strange thing about Vue, and I really like all the rest a lot ! /BL |
@druppy classes are not awesome. |
Ok, that was an interesting read, I understand the reason better now ... So I guess vue-class-component will enable static type checking in ts (I can fake data types in the class declaration), and the rest could be a good idea to reconsider (inheritance in this case). |
Fyi, The syntax specified by @yyx990803 does not seem to be valid anymore. Using |
@yyx990803 It's not about deep class inheritance, it's about using "extends" property according to how it's done everywhere and how it is described in the docs. Are you planning to remove "extends" in future releases of vue? |
Slight modification to @phil294 's export default {
name: 'MyComponent',
extends: OtherComponent,
methods: {
foo() {
let value = OtherComponent.options.methods.foo.call(this);
// do your thing, modify value, etc
return value;
},
},
}; |
vue-just-super - my implementation for call super() in child inherited components (both by It allows you to call parent component's method just by |
vue-super-options - It allows you to call parent component's method just by this.$supermethodName in child component's method |
It would be great to have
super()
method available to be able to call parent implementation.The text was updated successfully, but these errors were encountered: