默认头像防止裂图

This commit is contained in:
2024-04-16 20:06:06 +08:00
parent 6387168d3d
commit 91b81b8bf4
5 changed files with 10 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
ul(v-if="data.length")
li(v-for="item in data", :key="item._id")
NuxtLink(:to="`/user/${item.user._id}`")
img.avatar(:src="item.user.avatar")
img.avatar(:src="item.user.avatar" onerror="this.src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'")
.content
.name(:class="{ adminname: item.user.gid === 1 }") {{ item.user.name }}
.info
@@ -133,7 +133,7 @@ export default {
);
}
});
},
}
},
};
</script>

View File

@@ -3,7 +3,7 @@
ul(v-if="data.length")
li(v-for="item in data", :key="item._id")
NuxtLink(:to="'/user/' + item.user._id")
img.avatar(:src="item.user.avatar")
img.avatar(:src="item.user.avatar" onerror="this.src='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'")
NuxtLink.content(:to="'/thread/' + item._id")
.title {{ item.title }}
.info
@@ -58,7 +58,7 @@ export default {
rwdate(utc) {
let t = new Date(utc);
return t.getMonth() + 1 + "月 " + t.getDate() + ", " + t.getFullYear();
},
}
},
};
</script>