1<! DOCTYPE html>234<meta charset= "Utf-8" >5<title></title>6<link rel= "stylesheet" type= "Text/css" href= "Vue.css" >7<script src= "Https://cdn.bootcss.com/vue/2.4.2/vue.min.js" ></script>89<body>Ten<div id= "Vue-app" > One forCirculation A<!--array subscript-- -{{Characters[0] }} -{{Characters[1] }} the{{characters[2] }} -<!--array Traversal-- -<ul> -<li V- for= "character in characters" > + {{character}} -</li> +</ul> A at<ul> -<li V- for= "User in usermsg" style= "List-style:none;" > -{{User}}-{{user.name}}-{{User.age}} -</li> -</ul> - in -<ul><!--Index default location is: 0-- to<li V- for= "(User,index) in usermsg" style= "List-style:none;" > +{{Index}}-{{user.name}}-{{User.age}} -</li> the</ul> * for/h3> $<div V- for= "(User,index) in usermsg" >Panax Notoginseng -<p> Age: {{user.age}}</p> the</div> + A for the<template V- for= "(User,index) in usermsg" > + -<p> age:{{User.age}}</p> $</template> $ What is the difference between the two cases? - View HTML to know - the forPlus Inner Loop v- for -<template V- for= "(User,index) in usermsg" >Wuyi<div V- for= "(Value,key) in user" > the{{Key}}-{{value}} -</template> Wu</div> - About<script src= "App.js" ></script> $</body> -HTML1 NewVue ({2El: ' #vue-app ',3 data:{4characters:[' Mario ', ' Luffy ', ' Yoshi '],5 usermsg:[6{Name: "Henry", age:30},7{Name: "Bucky", age:30},8{Name: "Emily", age:30},9 ],Ten }, One methods:{ A - }, - computed:{ the - } -})
Vue.jsThe use of the Vue array dictionary template v-for