Home > Article > Web Front-end > How Vue.js divides components
What I bring to you this time is how to group pieces in Vue.js. This article will give you a good analysis.
For some common pages, everyone can sit together and type the code. After this page is completed, other pages can be created. However, as a system with complex functions, it is especially suitable to use somemodularizationDevelopedFramework, this will appear very inefficient, so we will simply look at how to divide components in Vue.
In summary, there are two ways to divide it. One is the functional blocks on the page, select, pagenation, and some parts that require a lot of code to implement. We can extract them and put them in group together or classify. There is also a way to divide it according to the page area, header, footer, sidebar. How are Vue components implemented after having components? APP.vue is an entrance to the project, and the components we divided are alsoobjects. In APP.vue, we use import to import each component Import, header refers to the header.vue file on the right. This writing method is a writing method of es6. Of course, if you do not need to use es6 componentization, you must also use some other requires to write and perform a packaging process. , if you just introduce these two components into app.vue Inside, these two components are still not available on the page.
In Vue, this component must be registered through components, and the imported Put it in, and then writenvm’s method of managing different versions of nodes
How to determine whether the CheckBox selected is empty
The above is the detailed content of How Vue.js divides components. For more information, please follow other related articles on the PHP Chinese website!