export default {
data () {
return {
items: [],
recPics16: [],
pagesize: 12,
pages: 0
};
},
created () {
this.getData();
},
methods: {
getData () {
let sno = this.$route.params.ss;
let _this = this;
this.$http.get('http://app.isfunweb.com/web/app/query.do', {params: {'key': '8a45608c16c76ef9f4a56b12e3f238be', 'pageSize': '98', 'a_no': '001', 'classify': '01', 's_no': sno}}).then((res) => {
_this.items = res.body.result;
console.log(_this.items.length);
}, (err) => {
console.log(err);
});
},
currentpage (p) {
this.recPics16 = this.items.slice(p * this.pagesize - 12, p * this.pagesize);
console.log(this.recPics16);
}
},
components: {
item8
},
watch: {
'$route': 'getData'
}
};
监听路由变化发送Ajax请求,数据都更新了,但视图怎么没更新。。。。
你可以看看官方文档,https://cn.vuejs.org/v2/guide...数组更新检测