Skip to content

Commit eab6a8e

Browse files
committed
Update README.md
1 parent ed00cb6 commit eab6a8e

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Vue File selector
22
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd2phap%2Fvue-file-selector.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd2phap%2Fvue-file-selector?ref=badge_shield)
33

4-
File selector component that supports drag-n-drop for Vuejs.
4+
File selector with validation that supports drag-n-drop for Vuejs.
5+
6+
### Other open source projects
7+
- `ImageGlass` - A lightweight, versatile image viewer: https://imageglass.org
8+
- `Fluent Reveal Effect Js` (Fluent Design System): https://github.com/d2phap/fluent-reveal-effect
9+
- `FileWatcherEx` - A wrapper of C# FileSystemWatcher for Windows: https://github.com/d2phap/FileWatcherEx
510

611
## Install
712
Run the command
@@ -30,12 +35,13 @@ Vue.use(FileSelector);
3035
<template>
3136
<div>
3237
<file-selector
33-
accept-extensions=".jpg"
34-
:height="300"
38+
accept-extensions=".jpg,.svg"
39+
:multiple="true"
40+
:max-file-size="5 * 1024 * 1024"
3541
@validated="handleFilesValidated"
3642
@changed="handleFilesChanged"
3743
>
38-
hahahah
44+
Select image files
3945
</file-selector>
4046
</div>
4147
</template>
@@ -62,16 +68,16 @@ export default {
6268
| -- | -- | -- |
6369
| `default` | `Select` | Content of the `Select` button. |
6470
| `loader` | `Loading...` | Content of loading state. |
65-
| `top` | ` ` | Top section content, above the `Select` button. |
66-
| `bottom` | ` ` | Bottom section content, below the `Select` button. |
71+
| `top` | `(empty)` | Top section content, above the `Select` button. |
72+
| `bottom` | `(empty)` | Bottom section content, below the `Select` button. |
6773

6874

6975
## Props
70-
| Name | Type | Default | Description |
76+
| Name | Type | Default | Description |
7177
| -- | -- | -- | -- |
7278
| `multiple` | `Boolean` | `false` | Allow multiple files selected. |
7379
| `isLoading` | `Boolean` | `false` | Show or hide the loading section (slot: `loader`). |
74-
| `acceptExtensions` | `String` | ` ` | List of file extensions accepted. Each extension separated by a comma (`,`). E.g. `accept-extensions=".zip,.rar"`. |
80+
| `acceptExtensions` | `String` | `(empty)` | List of file extensions accepted. Each extension separated by a comma (`,`). E.g. `accept-extensions=".zip,.rar"`. |
7581
| `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). |
7682
| `height` | `Number` | `NaN` | The height of droppable section. |
7783
| `validateFn` | `Function -> Boolean` | `() => true` | A custom validation function that returns boolean value. |
@@ -86,7 +92,7 @@ Function(result: String | Boolean, files: FileList): void
8692
```
8793
- `result`: validation result,
8894
+ returns `true` if the file validation is valid, else
89-
+ returns `false` or [Error codes](#error-codes).
95+
+ returns `false` or [Error codes (`string`)](#error-codes).
9096
- `files`: list of files validated.
9197

9298
### 2. `@changed`
@@ -109,4 +115,5 @@ List of error codes returned after validation.
109115

110116

111117
## License
112-
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd2phap%2Fvue-file-selector.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd2phap%2Fvue-file-selector?ref=badge_large)
118+
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd2phap%2Fvue-file-selector.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd2phap%2Fvue-file-selector?ref=badge_large)
119+

0 commit comments

Comments
 (0)