// super.js
import Vue from 'vue'
import Component from 'vue-class-component'
// Define a super class component
@Component
class Super extends Vue {
protected fo() {
return "Super";
}
}
import Super from './super'
import Component from 'vue-class-component'
// Extending the Super class component
@Component
export default class HelloWorld extends Super {
created() {
console.log(this.fo());
}
protected fo() {
return super.fo() + " HelloWorld";
}
}
On the console.log() I would expect "Super HelloWorld", instead I found a JS error;
index.js:56 TypeError: (intermediate value).fo is not a function
at VueComponent.fo
version: 7.2.6
I have a class that extends from another one. Something similar to: https://class-component.vuejs.org/guide/extend-and-mixins.html#extend
On the console.log() I would expect "Super HelloWorld", instead I found a JS error;
Here the link with a jsfiddle to reproduce this case. https://jsfiddle.net/ouk9nt1d/