chore(Preview): 消除 onerror 参数类型错误

This commit is contained in:
invalid w 2023-10-08 18:25:11 +08:00
parent a5a11fb846
commit ec33820bf9

View File

@ -210,8 +210,8 @@
imgState.currentUrl = url;
imgState.status = StatueEnum.DONE;
};
img.onerror = (e: Event) => {
const ele: EventTarget[] = e.composedPath();
img.onerror = (e: Event | string) => {
const ele: EventTarget[] = (e as Event).composedPath();
ele &&
emit('img-error', {
index: imgState.currentIndex,