Avatar Element

An element used for profile images.

#Examples

#Options

Name Type Description
url string The url to be prepended to the file's URI.
disabled boolean Whether the field is disabled.

#Properties

Name Type Default Description
disabled boolean false Whether the field is disabled.
file object null The element's File object containing information about the uploaded file. Available properties: file, base64, preview, name, displayName, link.
url boolean null If the file is clickable this will be prepended to the file's URI.
defaultValue string null Value of element when the form is initially loaded or reseted.
lightbox$ object null Lightbox component which appears when the image is clicked.
originalName string - The original name of the uploaded file.

#Methods

# .disable()

Disabled the field.


# .enable()

Enables the field.


# .change(File)

Parameters
  • File File : Javascript file object

Changes the uploaded file and trigger it's change event.


# .set(File)

Parameters
  • File object : Javascript File object.

Converts a javascript File object to element's File object and set it as the file property.


# .remove()

Removes the element's File object.


#Slots

# preview

Props
  • el$ object : The element component.
  • add function : Adds a new image.
  • remove function : Removes the image.
  • preview function : Opens image preview.

Contains the avatar preview.


#Events

# add

Triggered when a new file is selected by the user.


# remove

Triggered when the element's file is removed.