Forms
FormUploadImage
Drag-and-drop image upload with preview.
Forms
Enhanced form components for uploads, rich text editing, and search inputs.
Components
<XAFormUploadImage />
Drag-and-drop image upload with preview.
<XAFormUploadImage
v-model="imageUrl"
:upload-url="'/api/upload/image'"
accept="image/*"
:max-size-mb="5"
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | '' | Current image URL via v-model; updated after a successful upload |
uploadUrl | string | required | POST endpoint that receives the image as multipart/form-data |
accept | string | 'image/*' | MIME type filter for the file picker |
maxSizeMb | number | 5 | Maximum allowed file size in megabytes |
AI Context
component: XAFormUploadImage
package: "@xenterprises/nuxt-x-app"
category: Form
use-when: Admin forms requiring image uploads with drag-and-drop and preview
upload-pattern: requires upload-url prop pointing to POST endpoint, emits update:modelValue with the uploaded image URL
