Modules and components, modularization and componentization

Front-end modularity

module (js module)

(1) Split a huge js file into js files with specific functions one by one.
(2) With the increase of business logic and the amount of code, it is necessary to split the js file into modules for use.
(3) Reuse js, simplify the writing of js, and improve the operating efficiency of js.

Modular

When the js of the application is written in modules, the application is a modular application.

Components (one level higher than modules, not just split js code)

(1) A collection of codes and resources (html, css, js, image, etc.) used to achieve local functional effects.
(2) A collection of all structures, styles, fonts, pictures, and audios to realize a function.
(3) Reuse the code, simplify the coding of the project, and improve the efficiency of operation.

Componentization

When an application is implemented in a multi-component manner, the application is a componentized application.

Guess you like

Origin blog.csdn.net/weixin_57780816/article/details/121216406