diff --git a/api-generator/components/avatar.js b/api-generator/components/avatar.js index b87088bc4..396e4b681 100644 --- a/api-generator/components/avatar.js +++ b/api-generator/components/avatar.js @@ -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' + } + ] } ]; diff --git a/components/lib/avatar/Avatar.d.ts b/components/lib/avatar/Avatar.d.ts index 19cb88874..0ad6ad6f2 100644 --- a/components/lib/avatar/Avatar.d.ts +++ b/components/lib/avatar/Avatar.d.ts @@ -125,7 +125,7 @@ export interface AvatarEmits { /** * Triggered when an error occurs while loading an image file. */ - error(): void; + error(event: Event): void; } /** diff --git a/components/lib/avatar/Avatar.vue b/components/lib/avatar/Avatar.vue index 3b3a736d9..892e6fa58 100644 --- a/components/lib/avatar/Avatar.vue +++ b/components/lib/avatar/Avatar.vue @@ -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, {