refactor: remove unnecessary watchers

This commit is contained in:
Pratik 2025-04-08 18:22:44 +05:30
parent a4781509c4
commit a466766c5c
8 changed files with 10 additions and 63 deletions

View File

@ -10,7 +10,7 @@
}"
row-key="name"
v-bind="$attrs"
ref="listViewRef"
@update:selections="$emit('selectionsChanged', Array.from($event || []))"
>
<ListHeader
class="sm:mx-5 mx-3"
@ -231,14 +231,7 @@ watch(pageLengthCount, (val, old_value) => {
})
const listBulkActionsRef = ref(null)
const listViewRef = ref(null)
watch(
() => Array.from(listViewRef.value?.selections || []),
(selections) => {
emit('selectionsChanged', selections)
},
)
defineExpose({
customListActions: computed(
() => listBulkActionsRef.value?.customListActions,

View File

@ -14,7 +14,7 @@
resizeColumn: options.resizeColumn,
}"
row-key="name"
ref="listViewRef"
@update:selections="$emit('selectionsChanged', Array.from($event || []))"
>
<ListHeader
class="mx-3 sm:mx-5"
@ -229,14 +229,6 @@ watch(pageLengthCount, (val, old_value) => {
})
const listBulkActionsRef = ref(null)
const listViewRef = ref(null)
watch(
() => Array.from(listViewRef.value?.selections || []),
(selections) => {
emit('selectionsChanged', selections)
},
)
defineExpose({
customListActions: computed(

View File

@ -14,7 +14,7 @@
resizeColumn: options.resizeColumn,
}"
row-key="name"
ref="listViewRef"
@update:selections="$emit('selectionsChanged', Array.from($event || []))"
>
<ListHeader
class="sm:mx-5 mx-3"
@ -273,14 +273,6 @@ watch(pageLengthCount, (val, old_value) => {
})
const listBulkActionsRef = ref(null)
const listViewRef = ref(null)
watch(
() => Array.from(listViewRef.value?.selections || []),
(selections) => {
emit('selectionsChanged', selections)
},
)
defineExpose({
customListActions: computed(

View File

@ -9,7 +9,7 @@
resizeColumn: options.resizeColumn,
}"
row-key="name"
ref="listViewRef"
@update:selections="$emit('selectionsChanged', Array.from($event || []))"
>
<ListHeader
class="sm:mx-5 mx-3"
@ -217,14 +217,6 @@ watch(pageLengthCount, (val, old_value) => {
})
const listBulkActionsRef = ref(null)
const listViewRef = ref(null)
watch(
() => Array.from(listViewRef.value?.selections || []),
(selections) => {
emit('selectionsChanged', selections)
},
)
defineExpose({
customListActions: computed(

View File

@ -14,7 +14,7 @@
resizeColumn: options.resizeColumn,
}"
row-key="name"
ref="listViewRef"
@update:selections="$emit('selectionsChanged', Array.from($event || []))"
>
<ListHeader
class="sm:mx-5 mx-3"
@ -285,14 +285,6 @@ watch(pageLengthCount, (val, old_value) => {
})
const listBulkActionsRef = ref(null)
const listViewRef = ref(null)
watch(
() => Array.from(listViewRef.value?.selections || []),
(selections) => {
emit('selectionsChanged', selections)
},
)
defineExpose({
customListActions: computed(

View File

@ -13,7 +13,7 @@
resizeColumn: options.resizeColumn,
}"
row-key="name"
ref="listViewRef"
@update:selections="$emit('selectionsChanged', Array.from($event || []))"
>
<ListHeader
class="sm:mx-5 mx-3"
@ -214,14 +214,6 @@ watch(pageLengthCount, (val, old_value) => {
})
const listBulkActionsRef = ref(null)
const listViewRef = ref(null)
watch(
() => Array.from(listViewRef.value?.selections || []),
(selections) => {
emit('selectionsChanged', selections)
},
)
defineExpose({
customListActions: computed(

View File

@ -9,7 +9,7 @@
resizeColumn: options.resizeColumn,
}"
row-key="name"
ref="listViewRef"
@update:selections="$emit('selectionsChanged', Array.from($event || []))"
>
<ListHeader
class="mx-3 sm:mx-5"
@ -233,14 +233,6 @@ watch(pageLengthCount, (val, old_value) => {
})
const listBulkActionsRef = ref(null)
const listViewRef = ref(null)
watch(
() => Array.from(listViewRef.value?.selections || []),
(selections) => {
emit('selectionsChanged', selections)
},
)
defineExpose({
customListActions: computed(

View File

@ -249,7 +249,9 @@
@applyFilter="(data) => viewControls.applyFilter(data)"
@applyLikeFilter="(data) => viewControls.applyLikeFilter(data)"
@likeDoc="(data) => viewControls.likeDoc(data)"
@selectionsChanged="(selections) => viewControls.handleSelectionsChange(selections)"
@selectionsChanged="
(selections) => viewControls.handleSelectionsChange(selections)
"
/>
<div v-else-if="leads.data" class="flex h-full items-center justify-center">
<div