Skip to content

Commit

Permalink
place selectallitems in a function
Browse files Browse the repository at this point in the history
  • Loading branch information
amiraabouhadid committed Oct 14, 2024
1 parent dc8df7b commit a4f1200
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</v-alert>
</template>
<template #[`header.data-table-select`]="{}">
<v-checkbox @change="e => (e.target.checked ? selectAllItems() : (selectedItems = []))"></v-checkbox>
<v-checkbox @change="updateSelectedItems"></v-checkbox>
</template>
<template #[`item.data-table-select`]="{ item }">
<v-checkbox v-model="selectedItems" :value="item"></v-checkbox>
Expand Down Expand Up @@ -133,13 +133,16 @@ export default {
const toPublicIP = ref();
const gateway = ref();
const isRemoving = ref(false);
const selectedItems = ref<string[] | number[] | symbol[] | undefined[]>([]);
const selectedItems = ref<any[]>([]);
const items = ref<RemoveFarmIPModel[]>([]);
const publicIpsPag = ref<PublicIp[]>([]);

onMounted(async () => {
await getFarmByID(props.farmId);
});
function updateSelectedItems(e: any) {
e.target.checked ? selectAllItems() : (selectedItems.value = []);
}
function selectAllItems() {
selectedItems.value = publicIps.value as any[];
}
Expand Down Expand Up @@ -215,6 +218,7 @@ export default {
showDialogue,
isRemoving,
removeFarmIps,
updateSelectedItems,
selectedItems,
loadingIps,
page,
Expand Down

0 comments on commit a4f1200

Please sign in to comment.