Vue.js table绑值

版权声明:转载原创文章请以超链接形式请注明原文章出处,尊重作者,尊重原创!


恰饭广告




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
    <div id="app">
            <table border="1px" width="600px">           
                    <tr>
                        <td>姓名</td>
                        <td>课程</td>
                        <td>系别</td>
                    </tr>
                    <tr v-for="person in student">
                        <td>{{ person.name}}</td>
                        <td>{{ person.course  }}</td>
                        <td>{{ person.dept  }}</td>
                    </tr>             
            </table>
       </div>

</body>
<script type="text/javascript">
  var json =[{"name":"daobin","course":"网站前端技术","dept":"软件系"},
                   {"name":"张三","course":"linux","dept":"软件系"},
                   {"name":"李四","course":"j2ee","dept":"软件系"}];
var vm = new Vue({
    el: '#app',
    data: {
        student: json
    }
});
</script>
</html>

原文链接:https://www.idaobin.com/archives/1960.html

让我恰个饭吧.ヘ( ̄ω ̄ヘ)

支付宝 ——————- 微信
图片加载中图片加载中



恰饭广告

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

39 − 30 =