Lib: Allow to pass an onclick handler for the card image
This commit is contained in:
@ -23,6 +23,9 @@
|
|||||||
|
|
||||||
/** The width class for the card, defaults to [w-auto] */
|
/** The width class for the card, defaults to [w-auto] */
|
||||||
width?: string;
|
width?: string;
|
||||||
|
|
||||||
|
/** An optional event handler for clicking the image */
|
||||||
|
imgonclick?: (event: Event) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@ -33,6 +36,7 @@
|
|||||||
imgid = undefined,
|
imgid = undefined,
|
||||||
imghidden = false,
|
imghidden = false,
|
||||||
width = "w-auto",
|
width = "w-auto",
|
||||||
|
imgonclick = undefined,
|
||||||
...restProps
|
...restProps
|
||||||
}: CardProps = $props();
|
}: CardProps = $props();
|
||||||
|
|
||||||
@ -53,6 +57,7 @@
|
|||||||
hidden={imghidden}
|
hidden={imghidden}
|
||||||
imgwidth={imgwidth ?? 0}
|
imgwidth={imgwidth ?? 0}
|
||||||
imgheight={imgheight ?? 0}
|
imgheight={imgheight ?? 0}
|
||||||
|
onclick={imgonclick}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user