Vue (1), Vue overview and introduction

1. What is Vue.js

  • Vue.js is currently the most popular front-end framework, and React is the most popular front-end framework (In addition to developing websites, React can also develop mobile apps. Vue syntax can also be used for mobile app development, which requires the help of Weex)

  • Vue.js is one of the mainstream front-end frameworks . Together with Angular.js and React.js, it has become the three mainstream front-end frameworks!

  • Vue.js is a framework for building user interfaces, focusing only on the view layer . It is not only easy to use, but also easy to integrate with third-party libraries or existing projects. (Vue has a supporting third-party class library, which can be integrated for large-scale project development)

  • The main work of the front-end? Mainly responsible for the v layer in MVC! The main job is to deal with the interface!

2. Why learn popular frameworks

  • Enterprises in order to improve development efficiency: In enterprises, time is efficiency, and efficiency is money!

    • In enterprises, the use of frameworks can improve the efficiency of development!
  • The development process to improve development efficiency: native JS ==> Jquery and other class libraries ==> front-end template engine ==> Angular.js / Vue.js (can reduce unnecessary DOM operations and improve rendering efficiency! Two-way data binding A certain concept [Through the instructions provided by the framework, front-end programmers only need to care about the business logic of the data, and no longer care about how the DOM is rendered])

  • In Vue, a core concept is to let users no longer manipulate DOM elements, freeing programmers' hands, and allowing programmers more time to focus on business logic!

3. The difference between framework and library

  • Framework: is a complete solution! The project is more intrusive. If the project needs to change the framework, the entire project needs to be re-architected.

    • express in node!
  • Library (plug-in): Provides a small function that is less intrusive to the project. If a library cannot fulfill certain requirements, you can easily switch to other libraries to achieve the requirements.

    • Switch from Jquery to Zepto
    • Switch from EJS to art-template

4. The difference between MVC in Node (back-end) and MVVM in front-end

  • MVC is a hierarchical back-end development concept ( 请查看Node相关知识)

    • view layer
    • app.js
    • router.js
    • controller layer
    • model layer
  • MVVM is the concept of the front-end view layer, which mainly focuses on the separation of the view layer, that is to say: MVVM divides the front-end view layer into three parts: Model, View, VM ViewModel

    • Model layer: save individual data for each page.
    • View layer: is the HTML structure of each page.
    • VM layer: ViewModel, is the core of MVVM thinking, because VM is the scheduler between Model layer and View layer. Whenever the v layer wants to obtain or save data, it must go through the vm for intermediate processing.
  • Why do we need MVVM if we have MVC?

    • The mvvm idea is used in the front-end page, mainly for the convenience of development. Because mvvm provides us with two-way binding of data. 数据的双向绑定是由VM提供的.

Guess you like

Origin blog.csdn.net/yangxshn/article/details/103003700