Heads-up: Our Vue 2 setup is currently not utilizing the Composition API and we have no immediate plans to do so. This discussion focuses on vue-class-components.
Query: The guide for vue-class-components mentions that we can employ a "normal" extends
to derive from a single parent component, or utilize the mixins
helper function to inherit multiple mixins.
Based on my understanding, a parent component is essentially a mixin (and vice versa), therefore I am curious whether the following code featuring a single parent component will produce identical child components:
import Vue from 'vue'
import Component from 'vue-class-component'
@Component
export class Parent extends Vue {
p = 'P'
}
@Component
export class ChildOne extends Parent {
created () {
console.log(this.p)
}
}
@Component
export class ChildTwo extends mixins(Parent) {
created () {
console.log(this.p)
}
}