diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index 9783a6cf6..5e0cd5162 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -3,14 +3,17 @@ import { ref, onMounted } from 'vue'; import axios from 'axios'; // import { useRouter } from 'vue-router'; // const router = useRouter(); + +const fabPos = ref([18, 18]); +const draggingFab = ref(false); + const gridView = ref(true); const loading = ref(false); const pagination = ref({ sortBy: 'id ASC', descending: false, page: 1, - rowsPerPage: 10, - rowsNumber: 10, + rowsPerPage: 5, }); const columns = [ @@ -75,7 +78,11 @@ async function onRequest(props) { params: { filter }, }); - customers.value = data; + for (const row of data) { + customers.value.push(row); + } + + //customers.value = newData; pagination.value.rowsNumber = await totalRows(); @@ -95,6 +102,23 @@ onMounted(() => { onRequest({ pagination: pagination.value }); }); +async function onLoad(index, done) { + console.log('scroll:', index); + + pagination.value.page = pagination.value.page + 1; + + await onRequest({ pagination: pagination.value }); + + done(); + //done(true); +} + +function moveFab(ev) { + draggingFab.value = ev.isFirst !== true && ev.isFinal !== true; + + fabPos.value = [fabPos.value[0] - ev.delta.x, fabPos.value[1] - ev.delta.y]; +} + // function navigate(id) { // router.push({ path: `/customer/${id}` }); // } @@ -103,80 +127,83 @@ onMounted(() => {