Skip to content

Commit 533e889

Browse files
committedFeb 5, 2025
fix(Toast)!: rename click to onClick for consistency
1 parent 2c192ac commit 533e889

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎playground/app/pages/components/toast.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function addToast() {
9898
add({
9999
id,
100100
...template,
101-
click(toast) {
101+
onClick(toast) {
102102
console.log(`Toast ${toast.id} clicked`)
103103
}
104104
})

‎src/runtime/components/Toaster.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ function getOffset(index: number) {
121121
'--transform': 'translateY(var(--translate)) scale(var(--scale))'
122122
}"
123123
:class="[ui.base(), {
124-
'cursor-pointer': !!toast.click
124+
'cursor-pointer': !!toast.onClick
125125
}]"
126126
@update:open="onUpdateOpen($event, toast.id)"
127-
@click="toast.click && toast.click(toast)"
127+
@click="toast.onClick && toast.onClick(toast)"
128128
/>
129129

130130
<ToastPortal :disabled="!portal">

‎src/runtime/composables/useToast.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ToastProps } from '../types'
44

55
export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
66
id: string | number
7-
click?: (toast: Toast) => void
7+
onClick?: (toast: Toast) => void
88
}
99

1010
export function useToast() {

0 commit comments

Comments
 (0)
Please sign in to comment.