refactor: alt为空导致崩溃

This commit is contained in:
dap
2025-08-01 09:41:29 +08:00
parent d92740b176
commit decc5d6e88
4 changed files with 5 additions and 6 deletions

View File

@@ -62,7 +62,7 @@ const diffUpdateTimeString = computed(() => {
<div class="flex w-full items-center justify-between text-[14px]"> <div class="flex w-full items-center justify-between text-[14px]">
<div class="flex items-center gap-1 overflow-hidden whitespace-nowrap"> <div class="flex items-center gap-1 overflow-hidden whitespace-nowrap">
<VbenAvatar <VbenAvatar
:alt="info.createByName" :alt="info?.createByName"
class="bg-primary size-[24px] rounded-full text-[10px] text-white" class="bg-primary size-[24px] rounded-full text-[10px] text-white"
src="" src=""
/> />

View File

@@ -51,7 +51,6 @@ defineOptions({
inheritAttrs: false, inheritAttrs: false,
}); });
// eslint-disable-next-line no-use-before-define
const props = defineProps<{ task?: TaskInfo; type: ApprovalType }>(); const props = defineProps<{ task?: TaskInfo; type: ApprovalType }>();
/** /**
@@ -415,7 +414,7 @@ async function handleCopy(text: string) {
</div> </div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<VbenAvatar <VbenAvatar
:alt="task.createByName" :alt="task?.createByName ?? ''"
class="bg-primary size-[28px] rounded-full text-white" class="bg-primary size-[28px] rounded-full text-white"
src="" src=""
/> />

View File

@@ -45,7 +45,7 @@ onMounted(async () => {
<template #dot> <template #dot>
<div class="relative rounded-full border"> <div class="relative rounded-full border">
<VbenAvatar <VbenAvatar
:alt="item.approveName" :alt="item?.approveName ?? 'unknown'"
class="bg-primary size-[36px] rounded-full text-white" class="bg-primary size-[36px] rounded-full text-white"
src="" src=""
/> />

View File

@@ -49,7 +49,7 @@ function handleOpen() {
function handleFinish(userList: User[]) { function handleFinish(userList: User[]) {
// 清空 直接赋值[]会丢失响应性 // 清空 直接赋值[]会丢失响应性
userListModel.value.splice(0, userListModel.value.length); userListModel.value.splice(0);
userListModel.value.push(...userList); userListModel.value.push(...userList);
emit('finish', userList); emit('finish', userList);
} }
@@ -70,7 +70,7 @@ const displayedList = computed(() => {
> >
<div> <div>
<VbenAvatar <VbenAvatar
:alt="user.nickName" :alt="user?.nickName ?? ''"
class="bg-primary size-[36px] cursor-pointer rounded-full border text-white" class="bg-primary size-[36px] cursor-pointer rounded-full border text-white"
src="" src=""
/> />