017——VUE中v-fo指令的使用方法
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>v-fo指令的使用方法</title> <script src="vue.js"></script> </head> <body> <div id="lantian"> <table border="1"> <tr> <th>序号</th> <th>编号</th> <th>标题</th> <th>老师</th> </tr> <tr v-for="(field,key) in news"> <td>{{key}}</td> <td>{{field.id}}</td> <td>{{field.title}}</td> <td>{{name}}</td> </tr> </table> </div> <script> var app=new Vue({ el:'#lantian', data:{ name:'大象', news:[ {id:11,title:'lantian.com'}, {id:22,title:'蓝天科技'} ] } }); </script> </body> </html>