- typed client and useFaq/useFaqApi (SSR, faq:<slug>:<locale> key, server and public bases, x-forwarded-for forwarded also on cached renders) - FaqBlock, FaqList and FaqItem: native details, exclusive and openFirst, server-sanitized description and answers, nothing or #fallback on 404, error or no items - FAQ tokens and base CSS with the .faq-html rules, README - node client tests and a playground SSR smoke against a fixture API
14 lines
576 B
Vue
14 lines
576 B
Vue
<script setup lang="ts">
|
|
// FaqItem: one question as a native <details>. The answer is HTML the FAQ
|
|
// API sanitized on output, so there is no client sanitizer.
|
|
defineProps<{ question: string; answer: string; name?: string; open?: boolean }>()
|
|
</script>
|
|
|
|
<template>
|
|
<details class="faq-item" :name="name" :open="open || undefined">
|
|
<summary class="faq-item__question">{{ question }}</summary>
|
|
<!-- eslint-disable-next-line vue/no-v-html -- sanitized by the FAQ API on output -->
|
|
<div class="faq-item__answer faq-html" v-html="answer" />
|
|
</details>
|
|
</template>
|