Lazy table demo fixes

pull/3711/head
Tuğçe Küçükoğlu 2023-03-09 10:54:55 +03:00
parent 3fce1c5c41
commit 0b6993d9ff
1 changed files with 6 additions and 11 deletions

View File

@ -181,10 +181,6 @@ export default {
]
}
},
customerService: null,
created() {
this.customerService = new CustomerService();
},
mounted() {
this.loading = true;
@ -302,7 +298,6 @@ const totalRecords = ref(0);
const customers = ref();
const selectedCustomers = ref();
const selectAll = ref(false);
const customerService = ref(new CustomerService());
const filters = ref({
'name': {value: '', matchMode: 'contains'},
'country.name': {value: '', matchMode: 'contains'},
@ -321,10 +316,10 @@ const loadLazyData = () => {
loading.value = true;
setTimeout(() => {
CustomerService.getCustomers({ lazyEvent: JSON.stringify(this.lazyParams) }).then((data) => {
this.customers = data.customers;
this.totalRecords = data.totalRecords;
this.loading = false;
CustomerService.getCustomers({ lazyEvent: JSON.stringify(lazyParams.value) }).then((data) => {
customers.value = data.customers;
totalRecords.value = data.totalRecords;
loading.value = false;
});
}, Math.random() * 1000 + 250);
};