Xhr响应未显示或未更改为消息

时间:2018-09-03 02:16:55

标签: laravel vue.js axios

我想将响应数据更改为成功消息或不显示数据,实际上我不知道该怎么做。结果是这样的:

图片:

result what i got

我要更改还是不显示:

i want to like this

代码:

    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);
            });


   },

0 个答案:

没有答案