1.4.0 • Published 4 years ago

@joblocal/vue-bucket-loader v1.4.0

Weekly downloads
178
License
MIT
Repository
github
Last release
4 years ago

Vue Bucket Loader

Downloads Size Zipped Size

This Project provides a SSR compatible vue component which can handle file upload / deleting directly to / from a AWS S3 Bucket.

Requirements

  • Yarn or npm
  • Vue 2.X.X

Installation

Using yarn:

$ yarn add @joblocal/vue-bucket-loader

Using npm:

$ npm install @joblocal/vue-bucket-loader

Usage

After installing the package you can use it as follows.

<template>
  <VueBucketLoader
    :signingUrl="http://localhost/your/endpoint/goes/here"
  />
</template>

<script>
  import VueBucketLoader from '@joblocal/vue-bucket-loader';

  export default {
    components: {
      VueBucketLoader,
    },
  };
</script>

Properties

PropertyRequiredTypeDescription
signingUrltrueString / FunctionProvide an endpoint to a backend service which can generate a presignedUrl.
beforeUploadfalseFunctionProvide a function to add additional checks before your files get uploaded, e.g. MIME-Type checking. Returned File objects are used for upload.
allowedFileExtensionsfalseArrayProvides possibility to pass specific file extensions.
allowedMimeTypesfalseArrayProvides possibility to pass specific MIME type.

Events

This component provides event-handling for the following cases. To subscribe:

this.$on('Event', function( payload ));
EventDescriptionPayload
"add-files-before"This event will be emitted after a file was added to the input field.Array
"add-file-success"This event will be emitted after a file was successfully uploaded.Object
"add-file-error"This event will be emitted after a file was not uploaded.Object
"delete-file-before"This event will be emitted before a file will be removed.Object
"delete-file-success"This event will be emitted after a file was successfully deleted.Object
"delete-file-error"This event will be emitted after a file was not deleted.Object

File loading state

StateDescription
"loading"This file being uploaded.
"success"The file has been successfully added to the bucketloader.
"error"The file was not added due to a server error

Development

Installing dependencies

Run this command.

$ yarn install

Test

To make sure that the installation went fine. Run this command.

$ yarn test

Dev Server

To start the development server use

$ yarn start

Built with

Also see

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and feature requests.

Authors

See also the list of contributors who participated in this project.

1.4.0

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.23

5 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago