<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <!-- 数据渲染界面 --> <!-- 绑定表单元素 --> <div id="abc"> <div class="add"> <input type="text"> <input type="button" value="添加"> </div> <div class="add"> <input type="text" placeholder="请输入你想输入的名称"> </div> <div> <table class="tb"> <tr> <th>编号</th> <th>品牌名称</th> <th>创立时间</th> <th>操作</th> </tr> <tr v-for="(v,i) in list"> <td>{{i+1}}</td> <td>{{v.name}}</td> <td>{{v.date}}</td> <td> <a href="#">删除</a> </td> </tr> <tr> <td colspan="4">没有品牌数据</td> </tr> </table> </div> </div> <script src="./js/vue.js"></script> <script> var list = [{ name: 'TCL', date: new Date() }, { name: 'xx00', date: new Date() }, { name: 'TCL', date: new Date() }, ] var vm = new Vue({ //v-on里面的methods方法 el: '#abc', //模板ajax返回的数据 data: { msg: '我是歌谣', //等同于list:list list }, methods: { } }) </script> <!-- 列表渲染 --> <!-- 渲染数组 --> </body> </html>