Props
| Name | Description |
|---|---|
accept Type: string[] | File filter: MIME types ( Validated on picker and drop paths. Takes MIME types, wildcards, |
autofocus Type: Booleanish | Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field. |
disabled Type: booleanDefaultfalse | Disables the component Use while an application-owned upload is active so the selection cannot change mid-request. There is no |
errors Type: string | string[] | Error messages under the field, a string or array, in an Does not fill itself from |
formless Type: booleanDefaultfalse | Keep this control out of the enclosing |
hasErrors Type: booleanDefaultfalse | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. |
hasWarnings Type: booleanDefaultfalse | Define if the component should be in a warning state. Same chrome as errors with |
id Type: string | The |
maxFiles Type: number | Maximum number of acceptable files. Caps the existing and incoming selection together, and only applies in multiple mode. See example |
maxSize Type: number | Max size of the files in bytes. A per-file limit in bytes. Rejected files never enter the model. See example |
modelValue Type: File | File[] | null | Used by v-model. |
multiple Type: booleanDefaultfalse | Allows the selection of multiple items. Changes both behaviour and model shape: single mode replaces |
name Type: string | Defines the name of the input. Required inside a |
pt Type: PtMap<BbDropzonePtPart, BbDropzonePtState> | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | Passthrough, attribute form: one attribute per part, |
readonly Type: booleanDefaultfalse | Shows the files; the user cannot change them: drop, the file picker and the |
rules Type: RuleExpression<File | File[] | null> | vee-validate rules for this field. Only inside a Checks the accepted files only: type, size and count rejections never reach the model, so they arrive through |
tag Type: LayoutTagDefault"div" | Element rendered as the component's wrapper. |
validationLabel Type: string | The field's name in validation messages ( Set it when you use string rules: with no label, messages otherwise say "This field". See example |
validationMode Type: ValidationMode | When the field validates: |
warnings Type: string | string[] | Warning messages under the dropzone, a string or string array: amber, in their own |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
modelValue Type: File | File[] | null | Contains validated files only. Upload progress, cancellation, retry, and server errors remain application-owned state. See example |
Events
| Name | Description |
|---|---|
blur Type: (event: FocusEvent): void | Emitted when the file input loses focus. Forwards the original DOM |
error Type: (errors: DropZoneError[]): void | Emitted once per drop or pick that rejected any file, AFTER that gesture's Emits once per drop or pick that rejected anything, after its |
focus Type: (event: FocusEvent): void | Emitted when the file input receives focus. Forwards the original DOM |
update:modelValue Type: (value: File | File[] | null): void | Emitted when the selected files change. Payload is the new file or file array. |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
default Type: BbDropzoneDefaultSlotProps | The drop zone area content. Renders inside the The visible drop surface. Put |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
hasWarninghasWarningsfails silentlyvalidateOnvalidationModefails silentlyAn array of events became one mode (
aggressive|balanced|lazy|submit-only|submit-live). The old defaults (['blur'],['inactive'], a toggle's['update:modelValue', 'change', 'blur']) arebalanced, the new default: delete the prop. A text field on['update:modelValue']isvalidation-mode="aggressive". Set it once on<BbForm validation-mode>instead of per field.vidremovedfails silentlyA display name (v2:
vid="Email address") is nowvalidation-label; a field path (3.0 betas:vid="address.city") is nowname(brackets for a native post:address[city]).check --fixpicks by the value.