<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="app">
<h1 v-for="(student, index) in students">{{index}}-->{{student.name}}-->{{student.age}}</h1>
</div>
<script src="./vue.js"></script>
<script>
const app = new Vue({
el: '#app',
data: {
students: [{
name: '江芦贵',
age: 20
},
{
name: '黄聪聪',
age: 20
},
{
name: '张康',
age: 20
},
]
}
});
</script>
</body>
</html>
V-for rendering list
Guess you like
Origin blog.csdn.net/qq_45802159/article/details/103816575
Recommended
Ranking