mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(Toast)!: rename click to onClick for consistency
This commit is contained in:
@@ -98,7 +98,7 @@ function addToast() {
|
||||
add({
|
||||
id,
|
||||
...template,
|
||||
click(toast) {
|
||||
onClick(toast) {
|
||||
console.log(`Toast ${toast.id} clicked`)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -121,10 +121,10 @@ function getOffset(index: number) {
|
||||
'--transform': 'translateY(var(--translate)) scale(var(--scale))'
|
||||
}"
|
||||
:class="[ui.base(), {
|
||||
'cursor-pointer': !!toast.click
|
||||
'cursor-pointer': !!toast.onClick
|
||||
}]"
|
||||
@update:open="onUpdateOpen($event, toast.id)"
|
||||
@click="toast.click && toast.click(toast)"
|
||||
@click="toast.onClick && toast.onClick(toast)"
|
||||
/>
|
||||
|
||||
<ToastPortal :disabled="!portal">
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { ToastProps } from '../types'
|
||||
|
||||
export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
|
||||
id: string | number
|
||||
click?: (toast: Toast) => void
|
||||
onClick?: (toast: Toast) => void
|
||||
}
|
||||
|
||||
export function useToast() {
|
||||
|
||||
Reference in New Issue
Block a user