diff --git a/src/views/FaqView.vue b/src/views/FaqView.vue index 5a2a17a..316085f 100644 --- a/src/views/FaqView.vue +++ b/src/views/FaqView.vue @@ -5,8 +5,17 @@ import markdownit from "markdown-it"; const { locale, messages } = useI18n(); +function isFaqPage(obj: unknown): obj is { content: Array<{ question: string; answer: string }> } { + return typeof obj === "object" && obj !== null && "content" in obj; +} + const faqContent = computed(() => { - return (messages.value[locale.value].faqPage as any).content; + const currentMessages = messages.value[locale.value]; + + if (isFaqPage(currentMessages.faqPage)) { + return currentMessages.faqPage.content; + } + return []; }); const md = markdownit({ @@ -29,7 +38,7 @@ const md = markdownit({ >
-

+

{{ item.question }}