Form
Image upload and preview
resources/js/Components/Form/ImageUpload.vue
Props
Use props to style the look of the component:
Image
image?: string
Uploaded image or placeholder.
accept?: string
Input file accept
attribute. Defaults to image/*
.
isIcon?: boolean
Set as true
for icon uploads.
For icon uploads default accept value is image/png,image/svg+xml
Button label
btnLabel?: string
Label for image select button. Defaults to “Upload image”.
ID
id?: HTMLAttributes["id"]
ID of the file input.
Class
class?: HTMLAttributes["class"]
Style the wrapper.
On file change event
Full docs coming soon…
Example
You can render default component or customized it using the Vue slots.