Skip to content

Commit 21c9e87

Browse files
committed
fix: support action badge
1 parent a498586 commit 21c9e87

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

adminforth/spa/src/views/ListView.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
<span class="sr-only">Loading...</span>
6767
</div>
6868
{{ `${action.label} (${checkboxes.length})` }}
69+
<div v-if="action.badge" class="text-white bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800
70+
font-medium rounded-sm text-xs px-1 ml-1 text-center ">
71+
{{ action.badge }}
72+
</div>
6973
</button>
7074

7175
<RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"

adminforth/types/Common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ export interface AdminForthBulkActionCommon {
103103
**/
104104
state?: 'danger' | 'success' | 'active';
105105

106+
/**
107+
* Optional small badge for button which will be displayed in the list view
108+
*/
109+
badge?: string,
110+
106111
/**
107112
* Icon for action button which will be displayed in the list view
108113
*/

0 commit comments

Comments
 (0)