Fixed #4222 - Avatar: Return target in error event callback
parent
e7f11e883e
commit
81de29c8ca
|
@ -53,7 +53,14 @@ const AvatarSlots = [
|
||||||
const AvatarEvents = [
|
const AvatarEvents = [
|
||||||
{
|
{
|
||||||
name: 'error',
|
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'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ export interface AvatarEmits {
|
||||||
/**
|
/**
|
||||||
* Triggered when an error occurs while loading an image file.
|
* Triggered when an error occurs while loading an image file.
|
||||||
*/
|
*/
|
||||||
error(): void;
|
error(event: Event): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -17,8 +17,8 @@ export default {
|
||||||
extends: BaseAvatar,
|
extends: BaseAvatar,
|
||||||
emits: ['error'],
|
emits: ['error'],
|
||||||
methods: {
|
methods: {
|
||||||
onError() {
|
onError(event) {
|
||||||
this.$emit('error');
|
this.$emit('error', event);
|
||||||
},
|
},
|
||||||
getPTOptions(key) {
|
getPTOptions(key) {
|
||||||
return this.ptm(key, {
|
return this.ptm(key, {
|
||||||
|
|
Loading…
Reference in New Issue