vue/07-v-for属性的使用/v-for对象的使用.html

23 lines
549 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app">
<div v-for="item,key,index in info">{{item}}的键是{{key}}他所在的下标为{{index}}</div>
</div>
</body>
<script src="../JavaScript/vue.min.js"></script>
<script>
const vue=new Vue({
el:"#app",
data:{
info:{id:201,name:"小浠",add:"none"}
}
})
</script>
</html>