Vue, as one of the most fiery frameworks of the 2016, is popular with its light weight and easy to learn features. Let's take a brief look at the use of Vue today.
First, you need to download Vuejs on the website, or use the CDN library directly. The following example uses Vue to implement data binding and judgment loops:
1<! DOCTYPE html>2.34<meta charset= "UTF-8" >5<title></title>67<body>8<div id= "App1" >9<!--vue to judge-Ten<span V-if= "OK" > One {{message}} A</span> -<!--Vue Loop-- -<ul> the<li V- for= "L in List" > - My name is {{l.name}},i ' {l.age}} years old -</li> -</ul> +</div> -<!--introduction of CDN Library, the introduction of JS needs at the bottom--- +<script src= "//cdn.bootcss.com/vue/2.1.8/vue.min.js" ></script> A<script src= "Js/v1.js" type= "Text/javascript" charset= "Utf-8" ></script> at</body> -JS Code:
DECLARE 02.var app1=new Vue ({ . Binds the DOM element . El: ' #app1 ', for . data:{ . Message: "Hello World", " . list:[ . {name: ' Lvxueyuan ', age:15}, . {name: ' Xueyuan ', age:15}, ten. {name: ' Yuan ', age:15}, one by one . {name: ' LV ', age:15}, . {name: ' Lvxue ', age:15} "." Ok:1 . } 16.})
Come on, everybody, try it!!!
Vuejs Entry-Level simple example