|
10 | 10 | :adminUser="coreStore.adminUser" |
11 | 11 | /> |
12 | 12 | <BreadcrumbsWithButtons> |
13 | | - <template v-if="coreStore.resource?.options?.bulkActions"> |
14 | | - <button |
15 | | - v-for="action in coreStore.resource.options.bulkActions.filter(a => a.showIn?.showButton)" |
16 | | - :key="action.id" |
17 | | - @click="startCustomAction(action.id)" |
18 | | - :disabled="actionLoadingStates[action.id]" |
19 | | - class="flex items-center py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700" |
20 | | - > |
21 | | - <component |
22 | | - v-if="action.icon" |
23 | | - :is="getIcon(action.icon)" |
24 | | - class="w-4 h-4 me-2 text-lightPrimary dark:text-darkPrimary" |
25 | | - /> |
26 | | - {{ action.name }} |
27 | | - </button> |
| 13 | + <template v-if="coreStore.resource?.options?.actions"> |
| 14 | + |
| 15 | + <template v-for="action in coreStore.resource.options.actions.filter(a => a.showIn?.showButton)" > |
| 16 | + <component |
| 17 | + v-if="action.customComponent" |
| 18 | + :is="getCustomComponent(action.customComponent)" |
| 19 | + :meta="action.customComponent.meta" |
| 20 | + @callAction="startCustomAction(action.id)" |
| 21 | + :disabled="actionLoadingStates[action.id]" |
| 22 | + > |
| 23 | + <button |
| 24 | + :key="action.id" |
| 25 | + class="flex items-center py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700" |
| 26 | + > |
| 27 | + <component |
| 28 | + v-if="action.icon" |
| 29 | + :is="getIcon(action.icon)" |
| 30 | + class="w-4 h-4 me-2 text-lightPrimary dark:text-darkPrimary" |
| 31 | + /> |
| 32 | + {{ action.name }} |
| 33 | + </button> |
| 34 | + </component> |
| 35 | + |
| 36 | + <button |
| 37 | + v-else |
| 38 | + :key="action.id" |
| 39 | + @click="startCustomAction(action.id)" |
| 40 | + :disabled="actionLoadingStates[action.id]" |
| 41 | + class="flex items-center py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700" |
| 42 | + > |
| 43 | + <component |
| 44 | + v-if="action.icon" |
| 45 | + :is="getIcon(action.icon)" |
| 46 | + class="w-4 h-4 me-2 text-lightPrimary dark:text-darkPrimary" |
| 47 | + /> |
| 48 | + {{ action.name }} |
| 49 | + </button> |
| 50 | + </template> |
28 | 51 | </template> |
29 | 52 | <RouterLink v-if="coreStore.resource?.options?.allowedActions?.create" |
30 | 53 | :to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }" |
|
0 commit comments