
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@nagoos/vue-image-picker
Advanced tools
Easily select and upload images with this image picker component styled using Vuetify components!
A VueJS component which allows users to upload their images. Users can select one or more images for upload. The component shows the progress of the uploads and indicates when they are complete.
See working demo
png
and jpg
)yarn add @nagoos/vue-image-picker
When using ES imports, import the ImagePicker
component and imageUploadingStates
enum and use them in your component
import { ImagePicker, imageUploadingStates } from "@nagoos/vue-image-picker"
The v-model is an image array that holds the images the user has selected. The activeImageUploads property allows the ImagePicker
component to communicate the upload status of the images the user has selected.
<ImagePicker v-model="images" :activeImageUploads="activeImageUploads">
<v-flex xs4 md3>
<img :src="placeholderImage" width="100%" height="100%">
</v-flex>
</ImagePicker>
The following props are available to customize vue-image-picker
:
Prop | type | description | default |
---|---|---|---|
max | Int | Limit the number of images that can be uploaded. null for unlimited | null |
maxSize | Int | Limit the maximum size of any one image in bytes. | 8192 * 1024 (8192 KB) |
validImageTypes | [String] | The image mime types which the user is allowed to upload | ['png', 'jpg', 'jpeg'] |
v-model | [Object] | The images selected by the user. See Images model section for details | [] |
activeImageUploads | Object | Communcates the upload progress and state of images managed by the component. See Active Image Uploads section | {} |
exceedMaxImagesError | String | A message to show the user when they try to upload more images than allowed by the max prop | 'The maximum number of images was exceeded by your selection. ' |
invalidFileTypeError | String | A message to show the user when they attempt to upload an image with an invalid file type | 'Invalid file type. Please upload 'png' or 'jpg' files. ' |
fileSizeError | String | A message to show the user when one of their images is larger than the maxSize prop | 'One or more of the files you attempted to upload is larger than the single-file size limit. ' |
maxImagesUnit | String | Allows for localization of the word 'images' | 'images ' |
clearedImagesMessage | String | The message that is shown to the user when the clear the images in the component | 'Cleared images ' |
clearImagesLabel | String | The label for the clear button. Forced uppercase | 'clear ' |
addImagesLabel | String | The label for the add images button. Forced uppercase | 'add images ' |
The vue-image-picker
's model is an array of Objects which represents an array of images selected by the user.
Each object contains the following properties
A native File
object created by the browser when the user selects a file
A data url which can be assigned to an <img>
's src
to show the selected file
A key representing a unique image name
The name of the image file selected by the user
An Object containing the active upload state of images selected by the user. For each image that the system wishes to indicate the upload state of, there should be a key-value pair added to the Object:
The key
should equal the key of the image entry in the images[]
array that the system wishes to indicate an upload state for.
The value
is an Object with two properties:
{
progress,
state
}
The progress
's value should be a Number between 0 and 100 to indicate the percentage progress of the image upload.
The state
's value should be one of the imageUploadingStates
enums: NEW
, UPLOADING
, ERROR
, or COMPLETE
.
FAQs
Easily select and upload images with this image picker component styled using Vuetify components!
The npm package @nagoos/vue-image-picker receives a total of 2 weekly downloads. As such, @nagoos/vue-image-picker popularity was classified as not popular.
We found that @nagoos/vue-image-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.