On the inheritance of Vue Component

recently looked at how Vue Component implements inheritance. By browsing the official documentation, I see that Vue Component extensions can be implemented using mixins and extends .

but there is a problem with both methods, and the lifecycle function of the super component is executed. Examples are as follows:

super component created!
component created!

so how do you do that, when both super component and component have lifecycle, only component"s lifecycle function will execute?

Sep.16,2021

default merge strategy for hook functions:

config.optionMergeStrategies</a>

optionMergeStrategies

Vue.config.optionMergeStrategies.created = function (parent, child, vm) {
  return parent;
}
Menu