美文网首页
2018-09-11

2018-09-11

作者: 梁小狗 | 来源:发表于2018-09-11 19:22 被阅读0次
<!DOCTYPE html>
<html lang="en">
1    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    table{
        width: 300px;
        color: #ff7c35;
    }
</style>
<body>
<div id="nbsp">
   <table border="1" cellspacing="0">
       <tr>
           <th>编号</th>
           <th>名称</th>
           <th>单价</th>
       </tr>
       <tr v-for="(value,index) in fruit">
           <td>{{index+1}}</td>
           <td>{{value.name}}</td>
           <td>{{value.price}}</td>
       </tr>
   </table>
</div>
<script src="js/vue.js"></script>
<script>
    new Vue({
        el:"#nbsp",
        data:{
            fruit:[
                {name:"apple",price:3},
                {name:"banana",price:3},
                {name:"mailefaolen",price:1000}
            ]
        }
    });
</script>
</body>
</html>

相关文章

网友评论

      本文标题:2018-09-11

      本文链接:https://www.haomeiwen.com/subject/jhfpgftx.html