Events
@click
The
@click
event is triggered when the user clicks on a photo.
Type
Event Name | Handler Type | Payload Type |
---|---|---|
click | PhotoClickHandler | PhotoClickPayload |
ts
type PhotoClickHandler = (payload: PhotoClickPayload) => void
type PhotoClickPayload = {
event: MouseEvent
photo: Photo
index: number
}
Usage
vue
<script setup lang="ts">
const onClick: PhotoClickHandler = (payload) => {
console.log(payload)
}
</script>
<template>
<PhotoAlbum @click="onClick" />
</template>
Example
No photo has been clicked yet, try it! 👇