mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🐛 修复解析异常
This commit is contained in:
@@ -27,6 +27,7 @@ import type { Component } from "vue";
|
||||
import TpImage from "./tp-image.vue";
|
||||
import TpMention, { type TpMention as TpMentionType } from "./tp-mention.vue";
|
||||
import TpText, { type TpText as TpTextType } from "./tp-text.vue";
|
||||
import TpUnknown from "./tp-unknown.vue";
|
||||
|
||||
type TpTexts = { children: Array<TpTextType | TpMentionType> } & TpTextType;
|
||||
type TpTextsProps = { data: TpTexts };
|
||||
@@ -36,7 +37,8 @@ const props = defineProps<TpTextsProps>();
|
||||
function getComp(text: TpTextType | TpMentionType): Component {
|
||||
if (typeof text.insert === "string") return TpText;
|
||||
if ("image" in text.insert) return TpImage;
|
||||
return TpMention;
|
||||
if ("mention" in text.insert) return TpMention;
|
||||
return TpUnknown;
|
||||
}
|
||||
|
||||
function getTitle(): string {
|
||||
|
||||
Reference in New Issue
Block a user