The usage and difference between vue mixins and extends

I came into contact with mixins and extends, in the project, but I don"t know exactly in which scenario these two attributes should be used, and what are the differences in details? do you have experienced people to help you answer? it"s best to have an example to illustrate, thank you

.
May.24,2021

extends creates a subclass and finally returns an instance of vue. Refer to the detailed introduction of the official website.
is generally used when writing components in js alone.
and the mixins option specifies the snippet to mix with, the script part of the vue code. For the blending rules of the method of the same name, see the official website.
blending can be thought of as a global method library for the vue version and does not affect a special way of handling existing vue logic. It is usually used between sibling components with similar business logic but different ones.

Menu