This is the fourth day of my participation in the August Text Challenge.More challenges in August

I met

Vue. Js is what

What is vue? The answer is on the front page: progressive JavaScript frameworks. It is flexible, easy to use and efficient. The homepage of the official website has a detailed introduction: cn.vuejs.org/v2/guide/

How to understand incremental

Personal Understanding:

  • Easy to learn, you can gradually learn
  • A startup project is simple, nothing superfluous, adding plug-ins to extend the project as needed.

Related features include: decoupled view and data, data driven, reusable components, front-end routing, state management, virtual DOM, etc.

Like React and Angular, Vue is an architectural pattern based on MVVM.

MVC – > MVP (omitted) – > MVVM

The general MVC architecture mode is that the front and back ends are not separated, such as ASP based on.NET and JSP based on Java. So why is it so well developed in MVC architecture, and why is it necessary to use MVVM? Let’s use a diagram to see what the MVC pattern does.

This is a model diagram of MVC, model corresponds to data, View corresponds to view, controller corresponds to controller. It looks like a nice closed loop, view-> Controller -> Model -> View, logical and easy to maintain, so what are the problems in this? Personal opinion:

  • The front and back ends are not separated, which increases learning costs and personnel problems
  • The specification is not strict enough, and if the MVC is not well understood and used, it may cause internal code confusion. For example, in the case of multiple controllers for multiple models, it can be a bit cumbersome to maintain.
  • With the development of multi-terminal (desktop, H5, applets) applications, controllers are no longer controlling routing and logic, but logic only, and are used as data interfaces without the involvement of the View.

So MVVM is good? It’s essentially an improved version of MVC, and it’s a good choice for now.

MVVM (Model-View-ViewModel) framework is the origin of MVP (Model-View-Presenter) mode and WPF combined with the development of a new framework. It builds on the existing MVP framework and incorporates new features of WPF to address increasingly complex customer needs.

So, MVVM has a long history. In fact, many front-end concepts have long been applied in the back-end, but the front-end field is now as the sun rises, accepting hundreds of long. Before, due to the limitations of many conditions (bandwidth/client, etc.), the front-end field is not very fast development, only need to complete simple functions. With the progress of society, people have not only limited to the functional requirements, but also need a good user experience, so ushered in the front-end spring.

Put a topic

Machine Language -> Assembly -> C -> C++ ->

C++ based encapsulation: C# (2000)/Java (1990s) c++ based explanation: javascript (1995) (since browsers are mostly written in c++)

Get to the point

Take a look at the architectural patterns of MVVM:

The MVVM is tied to the ViewModel, and the ViewModel changes automatically when the view changes, using a Data Binding, and vice versa. Steal two more pictures from the Internet (I think it is still very clear) :

How do I use vue.js

  • Import as CDN package on the page.
  • Install it using NPM.
  • Build a project using the official CLI, which provides full-featured build Settings for modern front-end workflows (for example, hot overloading, save prompts, and so on).

Commonly used is the first and the third, in the study of the use of the third way.

I would be honored if this article could be of any help to you. It would be a great honor if the article was liked by you.

Personal wechat: iotzzh Public Number: front-end Wechat personal website: www.iotzzh.com Github Address: github.com/956159241/T…