Vue series of tutorials (a) introducing the

What is Vue.js

  • Vue.js is a front-end framework for the most fire, React is one of the most popular front-end framework (React In addition to developing the website, the development of mobile App, Vue syntax can also develop mobile App, we need to help Weex)
  • Vue.js is the front end of one of the main frame , and Angular.js, React.js together, and become the mainstream of the three front-end framework!
  • Vue.js is a framework for building user interfaces, only concerned with the view layer , it is not only easy to use but also easy to integrate third-party libraries or existing project. (Vue supporting third-party libraries, developers can integrate up to do large-scale projects)
  • The main front-end? V in MVC is responsible for this layer; the main job is to deal with and interface to make the front page effect;

Why learn popular frameworks

  • In order to improve the efficiency of enterprise development; in business, time is efficiency, efficiency is money;
    • Enterprises using the framework can improve development efficiency
  • Improve the development efficiency of the development process: Soundtrack JS (various browser compatibility issues) -> Jquery like libraries (frequent operation dom elements, stitching dom) -> front-end template engine (data changes to be re-rendering the entire page ) -> Angular.js / Vue.js (can help us to reduce unnecessary DOM operations; improve rendering efficiency; the concept of two-way data binding framework directive [provided by our front-end programmer need only be concerned about the business logic of the data, DOM is no longer concerned with how the rendering])
  • In the Vue, and a core concept is to allow users no longer manipulate the DOM element, the liberation of the user's hands, so programmers can more time to focus on business logic;
  • Enhance their competitive time employment
    • I have no people, I have gifted

The difference between the frame and libraries

  • Frame: is a complete solution; for invasive project larger project if the framework needs to be replaced, you will need to re-structure the entire project
    • node in the express
  • Library (plug-in): Provides a small function, the project less invasive, if a library is not complete certain requirements, you can easily switch to another library implementation requirements.
      1. Jquery to switch from zepto
      1. EJS to switch from art-template

        And the difference between the MVC MVVM front end (rear end) of Node

  • MVC is the development of the concept of tiered backend
  • MVVM layer is a conceptual view of the distal end, it focused view of the separation layer, that is to say: a front end view of the MVVM layer, is divided into three parts Model, View, VM ViewModel

The first example of a Vue

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01.Vue的基本代码</title>
</head>
<body>
<!--将来 new 的 Vue 实例,会控制这个元素中的所有内容-->
<!--Vue 实例所控制的这个元素区域,就是我们的 V-->
<div id="app">
    <p>{{msg}}</p>
</div>
<!--1. 导入Vue的包-->
<script src="lib/vue.js"></script>
<script>
    // 2. 创建一个Vue的实例
    // 当我们导入包之后,在浏览器的内存中,就多了一个Vue构造函数
    // 注意:我们 new 出来的这个 vm 对象,就是我们 MVVM 中的VM调度者
    var vm = new Vue({
        el: '#app',  // 表示,当前我们new的这个Vue实例,要控制页面上的哪个区域
        // 这里的 data 就是 MVVM 中的 M,专门用来保存每个页面的数据
        data: {  // data 属性中,存放的是 el 中要用到的数据
            msg: '欢迎学习Vue'  // 通过 Vue 提供的指令,很方便的就把数据渲染到页面上,程序员不再手动操作DOM元素了【前端的Vue之类的框架,不提倡我们手动操作DOM元素了】
        }
    })
</script>
</body>
</html>

Guess you like

Origin www.cnblogs.com/lauyon/p/12288062.html