DEV Community

Discussion on: How to Structure a Typical Vue.js App

Collapse
 
jappyjan profile image
jappyjan

Solution 2 is the one to go.

For a typical site you would create a vue instance which wraps all over components of your site (mostly named “app”)

Inside of your app instance/component you place other components in which you may place sub components and so on...

Normally you don’t have to create one component per form, instead you would create on component per section of your site e.g one login component which wraps all a username and a password input field and all the login logic

Collapse
 
stephanusrex profile image
Neo

Thanks, jappyjan. By "wraps all over components", do you mean that "app" would be, say, a "div" that acts as a container for all the other components being used on the page? That is, you only "register" the div with the id of "app" and by virtue of the fact that that div "contains" other vue components, e.g., buttons, inputs, etc., that "wraps" them?

Or do you have to register them via some function call?

I know, very basic questions, but just trying to learn. Thanks for your patience.