Gathering detailed insights and metrics for vue-file-selector
Gathering detailed insights and metrics for vue-file-selector
Gathering detailed insights and metrics for vue-file-selector
Gathering detailed insights and metrics for vue-file-selector
npm install vue-file-selector
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
16 Stars
111 Commits
9 Forks
3 Watching
4 Branches
2 Contributors
Updated on 14 Jun 2024
Minified
Minified + Gzipped
JavaScript (43.95%)
Vue (40.78%)
SCSS (8.71%)
TypeScript (6.56%)
Cumulative downloads
Total Downloads
Last day
-28.6%
85
Compared to previous day
Last week
-26.3%
383
Compared to previous week
Last month
-20.8%
1,851
Compared to previous month
Last year
-16.5%
31,402
Compared to previous year
File selector with validation that supports drag-n-drop for Vuejs.
ImageGlass
- A lightweight, versatile image viewer: https://imageglass.orgFluent Reveal Effect Js
(Fluent Design System): https://github.com/d2phap/fluent-reveal-effectFileWatcherEx
- A wrapper of C# FileSystemWatcher for Windows: https://github.com/d2phap/FileWatcherExRun the command
npm i vue-file-selector@latest
NPM package: https://www.npmjs.com/package/vue-file-selector
Github source: https://github.com/d2phap/vue-file-selector
Please see Demo project for full example.
1// in main.ts 2 3import { createApp } from 'vue'; 4 5// import FileSelector main css 6import 'vue-file-selector/dist/main.css'; 7 8// import the FileSelector plugin 9import FileSelector from 'vue-file-selector'; 10 11 12import App from './App.vue'; 13 14createApp(App) 15 16 // then use it! 17 .use(FileSelector) 18 .mount('#app');
1<template> 2 <div> 3 <FileSelector 4 accept-extensions=".jpg,.svg" 5 :multiple="true" 6 :max-file-size="5 * 1024 * 1024" 7 @validated="handleFilesValidated" 8 @changed="handleFilesChanged"> 9 Select image files 10 </FileSelector> 11 </div> 12</template> 13 14<script lang="ts"> 15import { Options, Vue } from 'vue-class-component'; 16import { FsValidationResult } from 'vue-file-selector/dist'; 17 18@Options({}) 19export default class App extends Vue { 20 handleFilesValidated(result: FsValidationResult, files: File[]) { 21 console.log('Validation result: ' + result); 22 }, 23 24 handleFilesChanged(files: File[]) { 25 console.log('Selected files: '); 26 console.table(files); 27 }, 28} 29</script>
Name | Default | Description |
---|---|---|
default | Select | Content of the Select button. |
loader | Loading... | Content of loading state. |
top | (empty) | Top section content, above the Select button. |
bottom | (empty) | Bottom section content, below the Select button. |
Name | Type | Default | Description |
---|---|---|---|
multiple | boolean | false | Allow multiple files selected. |
isLoading | boolean | false | Show or hide the loading section (slot: loader ). |
acceptExtensions | string | (empty) | List of file extensions accepted. Each extension separated by a comma (, ). E.g. accept-extensions=".zip,.rar" . |
maxFileSize | number | NaN | Maximum size in byte of every single file allowed. E.g. :max-file-size="2*1024*1024" (only the files that ≤2 MB are allowed). |
height | number | NaN | The height of droppable section. |
validateFn | FsValidateFn | () => true | A custom validation function that returns boolean value. |
@validated
Occurs after the selected files validated.
1Function(result: FsValidationResult, files: File[]): void
result
: validation result,
true
if the file validation is valid, elsefalse
or Error codes (string
).files
: list of files validated.@changed
Occurs if the selected files pass validation.
1Function(files: File[]): void
files
: list of files validated.List of error codes returned after validation, see FsValidationResult
.
Code | Error description |
---|---|
EXTENSION_ERROR | The selected files contain invalid extensions. |
FILE_SIZE_ERROR | The selected files size exceeded limit. |
MULTIFILES_ERROR | Multiple files selection is not allowed. |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
24 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn Morefile-selector
Convert DataTransfer object to a list of File objects
postcss-selector-parser
> Selector parser with built in methods for working with selector strings.
@csstools/selector-specificity
Determine selector specificity with postcss-selector-parser
hast-util-parse-selector
hast utility to create an element from a simple CSS selector