File tree 2 files changed +12
-11
lines changed
2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 18
18
>
19
19
<card-header :item :altText />
20
20
<card-content :item :altText />
21
- <card-footer : item />
21
+ <card-footer v-if = " item.footerActions " :actions = " item.footerActions " />
22
22
</conditional-link >
23
23
</template >
24
24
25
25
<script setup lang="ts">
26
+ import type { CardFooterAction } from " ./CardFooter.vue" ;
26
27
import type { LinkProps } from " ./ConditionalLink.vue" ;
27
28
28
29
interface CardItemI {
@@ -40,12 +41,7 @@ interface CardItemI {
40
41
}[];
41
42
btn? : string ;
42
43
html? : string ;
43
- footerActions? : {
44
- title? : string ;
45
- onClick: (event : MouseEvent ) => void ;
46
- icon: string ;
47
- iconPack: " mdi" | " fa" ;
48
- }[];
44
+ footerActions? : CardFooterAction [];
49
45
}
50
46
51
47
export type CardItem = CardItemI & LinkProps ;
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" card-footer" v-if = " item.footerActions " >
2
+ <div class =" card-footer" >
3
3
<div
4
4
class =" btn btn--link btn--inline btn--med"
5
- v-for =" (action, index) in item.footerActions "
5
+ v-for =" (action, index) in actions "
6
6
:key =" index"
7
7
@click =" action.onClick"
8
8
>
18
18
</template >
19
19
20
20
<script setup lang="ts">
21
- import type { CardItem } from " ./Card.vue" ;
21
+ export interface CardFooterAction {
22
+ title? : string ;
23
+ onClick: (event : MouseEvent ) => void ;
24
+ icon: string ;
25
+ iconPack: " mdi" | " fa" ;
26
+ }
22
27
23
- defineProps <{ item : CardItem }>();
28
+ defineProps <{ actions : CardFooterAction [] }>();
24
29
</script >
You can’t perform that action at this time.
0 commit comments