1、加载数据
public String detail() {
jsonRoot.put("data", service.detail(ad.getId() == null ? -1 : ad.getId()));
jsonRoot.put("success", true);
return SUCCESS;
}
2、请求数据
1)主页点击标题跳转到明细:
<a href="javascript:void(0)" v-html="d.title" v-on:click="popupDetail(d)"></a>
2)实现方法
popupDetail: function (row) {
var thisVue = this;
thisVue.detailData = {};
$.ajax({
url: base + "/ad/detail.do?ad.id=" + row.id,
type: "post",
success: function (res) {
if (res.success && res.data) {
thisVue.detailData = res.data;
}
}
});
$("#popup_detail").modal();
},
3、在明细页面显示
<img v-bind:src="detailData.imagePath"/>