Skip to content

Commit

Permalink
🐛 修复特定内容渲染错误
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed May 26, 2024
1 parent 0c4a688 commit 8fed953
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/home/t-calendar-birth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<div v-for="i in next" :key="i.role_id" class="tcb-item">
<img :src="i.head_icon" :alt="i.name" @click="toBirth(i)" :title="i.name" />
<div class="tcb-item-info">
<span>{{ i.name }} 所属:{{ i.belong }}</span>
<span>{{ i.introduce }}</span>
<span>{{ i.name }} 所属:{{ i.belong === "" ? "未知" : i.belong }}</span>
<span>{{ parseDesc(i.introduce) }}</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -59,6 +59,12 @@ function toBirth(type: TGApp.Archive.Birth.RoleItem | true) {
}
router.push({ name: "留影叙佳期", params: { date: dateStr } });
}
function parseDesc(intro: string): string {
const dom = document.createElement("div");
dom.innerHTML = intro;
return dom.innerText;
}
</script>
<style lang="css" scoped>
.tcb-container {
Expand All @@ -72,6 +78,7 @@ function toBirth(type: TGApp.Archive.Birth.RoleItem | true) {
border-radius: 5px;
box-shadow: 0 0 5px inset var(--common-shadow-2);
overflow-y: auto;
row-gap: 10px;
}
.tcb-top-none,
Expand Down

0 comments on commit 8fed953

Please sign in to comment.