<script type="text/javascript" src="/js/vue-resource.js"/> <script type="text/javascript" src="/js/vue.min.js"/> <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"> <script dsrc="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
{
"id": "1305120309",
"violates": 0,
"borrows": 0,
"overdraft": 0,
"notReturns": 0,
"libraryBooks": [
{
"chargePerson": "王大海",
"borrowTime": "2017-04-22 18:05:10",
"name": "计算机入门",
"bookId": "051301"
},
{
"chargePerson": "王大海",
"borrowTime": "2017-04-22 18:06:11",
"name": "软件工程",
"bookId": "051302"
}
]
}
<script>
Vue.use(VueResource); //这个一定要加上,指的是调用vue-resource.js
new Vue({
el: '#vue-menu3', //div的id
data: {
libraryInfo: "" //数据,名称自定
},
created: function () { //created方法,页面初始调用
var url = "/library/libraryInfo";
this.$http.get(url).then(function (data) { //ajax请求封装
var json = data.bodyText;
var usedData= JSON.parse(json);
//我的json数据参考下面
this.libraryInfo = usedData["libraryBooks"];
}, function (response) { //返回失败方法调用,暂不处理
console.info(response);
})
}
});
</script>
<div id="vue-menu3">
<table class="table table-striped">
<caption>借阅书籍列表</caption>
<thead>
<tr>
<th>书籍编号</th>
<th>书名</th>
<th>管理人员</th>
<th>借阅时期</th>
<th>归还时间</th>
</tr>
</thead>
<tbody>
<tr v-for="value in libraryInfo">
<td>{{value.bookId}}</td>
<td>{{value.name}}</td>
<td>{{value.chargePerson}}</td>
<td>{{value.borrowTime}}</td>
<td>{{value.returnTime}}</td>
</tr>
</tbody>
</table>
</div>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有