"In short Vue understand the core of" reading notes

Vue.js (pronunciation / vjuː /, similar to the view) is a building user interfaces progressive frame .

Before explaining what is progressive framework, it is necessary to find out what is the framework

In the first front-end development, we use JS get DOM elements in HTML; such a way that is simple and practical, but with the increasing business needs, will make the code becomes confusing, difficult to maintain.

For example, there is now a demand for:

There is a picture, when clicked, you can record the number of times the clicks.

Next, there was a bit little change in demand

It requires two pictures, respectively, when clicked, can record their clicks.

Then just put the original copy of the code on it

But this demand when the picture becomes five, although this requirement can be achieved by copying and pasting the code, but this time the code will become bloated, although the change in the acceptable range, but at this time if further demand

Or five photos were recorded is the number of clicks, but this is a list of five separate images seem too much space, there is now only a picture of the location, to switch clicked the picture by selecting the button.

This demand looks very small, but it could lead to rewrite your code empty; in this case, can be found using JS DOM element acquired deficiencies that exist

To deal with this, the organization structure of the code can be divided into three sections, data (M) / View (V) / logic control (*)

  • Data segments: contains only the data content
  • View Plate: Responsible Change Style
  • Control logic: to establish contact between the plate and the view of the data sector

    code organization structure advantage of this is that when demand changes occur, only need to make changes to the appropriate section.

This development model is often said that the MV model, MVC / MVVM / MVP are all derived therefrom; the main purpose of this model is that, so that will not happen view the data directly ; It can be seen, "DOM flow "the flaw lies in the dom as a model, get data directly from the dom, dom by then modify the view, this is actually a mixed view of the model is not conducive to the maintenance of the code.

Therefore, MV * code organization slowly becomes a frame; selecting a team framework of the important reasons is that you can set in advance the organizational structure of the code is good, so the actual project development has a relatively clear way, without having to worry about an individual whose unique coding practices or negligence confusing code.

These are the understanding of the framework. Strictly speaking, Bootstrap and can not be called a framework, it is actually regarded as a set of tools CSS, mainly for interface beautification; Jquery just some repetitive operation has been simplified, and compatibility solutions, so just a convenient JS library operation.

During the study, we do not need to start to get to know all the Vue features and components, starting with the core began to learn, and then gradually expand. Meanwhile, in use, we did not need to put all the components are out, we need to use what it wants, and Vue also can easily be used in conjunction with other existing projects or frame.

Guess you like

Origin www.cnblogs.com/songyan/p/12168070.html