Is a component in vue an instance of vue?

Is a component in

vue an instance of vue?
when developing with a single-file component, there is only one new Vue (), in main.js and none of the other components have new. Is that also an instance of vue?

Mar.01,2021

1. The whole project is an instance of vue
2. Each page or component is an instance of vuecomponent


Yes.
the phrase that all components are instances means that you can use a separate component because a single component already has the conditions to be an instance.
this also reflects a guiding significance of development. When a component cannot be instantiated alone, it shows that the implementation of componentization is unreasonable, such as the communication requirements that rely on data, whether to properly handle the communication of components, and so on.


in a nutshell, everything with uid is an instance of vue. The
root is also called the root component, which is not fundamentally different from other components, as well as through function calls (such as the pop-up windows of each component library), as well as the addition of dom to body through append.

Why is there no new process for each single file component, because this process takes place where you can't see it (it should be in vue-loader)


1. Each component is an instance of vue

 Vue  Vue  () 

ide/components.html-sharp%E4%BB%80%E4%B9%88%E6%98%AF%E7%BB%84%E4%BB%B6%EF%BC%9F" rel=" nofollow noreferrer "> vue official website, when is the component?
2. Single file component developers personally understand that
main.js is the entry for the creation of a root vue instance, while the other .vue files are for the convenience of our developers to put html, js, and css in the same file. Webpack compiles these .vue files using vue-loader to generate vue component definitions. When a place import and uses this component, it is actually new a vue instance of this component

The

component is an example, but it is developed with a single file component. Using scaffolding, the compiler of the internal code cannot be seen. I don't know what function can't be realized when the landlord asks
? Just as everything is an object, for one reason, you have to abide by his idea when using someone else's framework. First of all, you have to remember the specification of the framework.
this is the simple way to learn.


A single-page application is an instance of vue.
each custom component is an instance of vueComponent, and the constructor of
vueComponent is the same as that of vue.


when there is only one vue instance, other custom components are defined. Just register the component with the current vue instance, please take a look at the official documentation, which will be helpful for you to understand.

Menu