VFilePicker
Props
| Name | Type | Description |
|---|---|---|
| accept | string | List of accepted files types |
| disabled | boolean | Sets the element's disabled state. A disabled element will not be included during form submission. |
| error-text | string | Provides a custom error message. Any current error state will be overridden. |
| file-too-big-error | string | Overrides the localized error message for file too big |
| helper-text | string | Provides additional information to help the user enter the correct information. To add HTML to the helper text, use the helper-text slot instead. |
| initial-value | string | The default value of the element. This value sets the value property only when the value property has not been explicitly set. |
| invalid-file-type-error | string | Overrides the localized error message for invalid file type |
| label | string | The label for the form element. |
| max-file-size | number | The maximum file size (in megabytes) for each file. |
| max-files | number | The max number of files that can be selected. Additional files will be rejected. |
| max-files-exceeded-error | string | Overrides the localized error message for max file exceed |
| name | string | The name of the element. This element's value will be surfaced during form submission under the provided name. |
| required | boolean | Require the field to be completed prior to form submission. |
| single-file | boolean | Whether to allow only a single file. Subsequent added file will replace the current file. |
| size | Enum:normalexpanded | The size the file-uploader should have. |
| value | string | The current value of the element. |
Events
| Name | Event Type | Description |
|---|---|---|
| blur | FocusEvent | Fires when the element loses focus. |
| change | CustomEvent<undefined> | Emitted when files are added or removed. |
| click | MouseEvent | Fires when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element. |
| focus | FocusEvent | Fires when the element receives focus. |
| input | Event | Fires when the value of an element has been changed. |
| keydown | KeyboardEvent | Fires when a key is pressed. |
| keyup | KeyboardEvent | Fires when a key is released. |
Slots
| Name | Description |
|---|---|
| helper-text | Describes how to use the file-picker. Alternative to the helper-text attribute. |
Methods
| Name | Type | Description |
|---|---|---|
| checkValidity | () => boolean | Return the current validity of the element. |
| removeAllFiles | () => unknown | Removes all files from the File Picker. |
| reportValidity | () => boolean | Return the current validity of the element. If false, fires an invalid event at the element. |