feat: rewrite component use effect

This commit is contained in:
caturbgs
2021-12-20 13:32:08 +07:00
parent 2e0eb03d3a
commit f89a1620db
6 changed files with 48 additions and 111 deletions

View File

@@ -7,7 +7,6 @@ export class Product {
data = [];
total_data = 0;
filterSupplier = null;
filterCategory = null;
filterSubCategory = null;
visibleModalProduct = false;
visibleModalFilterProduct = false;
@@ -31,7 +30,7 @@ export class Product {
async getData() {
try {
const response = await http.get(`/product/all?supplier=${this.filterSupplier}&category=${this.filterCategory}&sub-category=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`);
const response = await http.get(`/product/all?supplier=${this.filterSupplier}&sub-category=${this.filterSubCategory}&page=${this.page}&pageSize=${this.pageSize}`);
this.data = response.body.data.map((item, idx) => {
item.key = idx;
return item