我想将响应数据更改为成功消息或不显示数据,实际上我不知道该怎么做。结果是这样的:
图片:
我要更改还是不显示:
代码:
fetchPosts() {
let filterData = JSON.stringify(this.filterForm);
let url ='/admin/product_index_vue?page='+this.pagination.current_page;
if (this.filterForm.color.length > 0 || this.filterForm.productType.length > 0 || this.filterForm.sortBy != "") {
url = '/admin/product_index_vue?page='+this.pagination.current_page+'&filter='+filterData;
}
axios.get(url)
.then(response => {
this.products=response.data.products.data;
this.productcolors =response.data.productcolors;
this.categories=response.data.categories;
this.pagination = response.data.pagination;
this.path = response.data.products.path;
this.productsizes = response.data.productsizes;
})
.catch(error => {
console.log(error.response.data);
});
},