Fixed #4222 - Avatar: Return target in error event callback

pull/4239/head
Tuğçe Küçükoğlu 2023-08-02 12:18:47 +03:00
parent e7f11e883e
commit 81de29c8ca
3 changed files with 11 additions and 4 deletions

View File

@ -53,7 +53,14 @@ const AvatarSlots = [
const AvatarEvents = [
{
name: 'error',
description: 'Triggered when an error occurs while loading an image file.'
description: 'Triggered when an error occurs while loading an image file.',
arguments: [
{
name: 'event',
type: 'object',
description: 'Browser event'
}
]
}
];

View File

@ -125,7 +125,7 @@ export interface AvatarEmits {
/**
* Triggered when an error occurs while loading an image file.
*/
error(): void;
error(event: Event): void;
}
/**

View File

@ -17,8 +17,8 @@ export default {
extends: BaseAvatar,
emits: ['error'],
methods: {
onError() {
this.$emit('error');
onError(event) {
this.$emit('error', event);
},
getPTOptions(key) {
return this.ptm(key, {