Skip to content

Commit e65f705

Browse files
committed
fix: enhance CallActionWrapper to accept extra props and update ThreeDotsMenu to handle null bulkActions
1 parent c83ee3b commit e65f705

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

adminforth/spa/src/components/CallActionWrapper.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
</template>
66

77
<script setup lang="ts">
8-
const props = defineProps<{ disabled?: boolean }>();
8+
const props = defineProps<{ disabled?: boolean, extra?: any }>();
99
const emit = defineEmits<{ (e: 'callAction', extra?: any ): void }>();
1010
1111
function onClick() {
1212
if (props.disabled) return;
13-
const extra = { someData: 'example' };
14-
emit('callAction', extra);
13+
emit('callAction', props.extra);
1514
}
1615
</script>

adminforth/spa/src/components/ThreeDotsMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</a>
4242
</component>
4343
</li>
44-
<li v-for="action in bulkActions?.filter(a => a.showInThreeDotsDropdown)" :key="action.id">
44+
<li v-for="action in (bulkActions ?? []).filter(a => a.showInThreeDotsDropdown)" :key="action.id">
4545
<a href="#" @click.prevent="startBulkAction(action.id)"
4646
class="block px-4 py-2 hover:text-lightThreeDotsMenuBodyTextHover hover:bg-lightThreeDotsMenuBodyBackgroundHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover"
4747
:class="{

0 commit comments

Comments
 (0)