X Enterprises
nuxt-x-affiliate

Comment Form

Comment form with optional email, threading via parentId, and POST to your endpoint.

Comment Form

The XAFCommentForm component renders a name + comment textarea with an optional email field and a submit button. Pass parentId to render a reply form for a threaded comment thread. Emits a submit event and optionally POSTs to your endpoint.

Components

<XAFCommentForm />

<XAFCommentForm endpoint="/api/comments" @submit="onComment" />
<XAFCommentForm :parent-id="c.id" :require-email="true" />

Props

PropTypeDefaultDescription
parentIdstringParent comment ID for threaded replies.
endpointstringPOST { author, text, parentId? } here.
requireEmailbooleanfalseShow and require an email field.
placeholderstring"Add to the discussion…"Comment textarea placeholder.
submitLabelstring"Post comment"Submit button label.

Events

EventPayloadDescription
submit{ author, email?, text, parentId? }Fired on submit. Independent of the endpoint POST.

AI Context

component: XAFCommentForm
package: "@xenterprises/nuxt-x-affiliate"
use-when: Comment form with optional email and threaded replies via parentId. POSTs to endpoint and emits submit.
Copyright © 2026