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
| Prop | Type | Default | Description |
|---|---|---|---|
parentId | string | — | Parent comment ID for threaded replies. |
endpoint | string | — | POST { author, text, parentId? } here. |
requireEmail | boolean | false | Show and require an email field. |
placeholder | string | "Add to the discussion…" | Comment textarea placeholder. |
submitLabel | string | "Post comment" | Submit button label. |
Events
| Event | Payload | Description |
|---|---|---|
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.
