# vue-coe-progress

> vue-coe-progress ✅

Latest version **0.2.2** (published 2019-12-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-coe-progress
pnpm add vue-coe-progress
yarn add vue-coe-progress
bun add vue-coe-progress
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2019-12-23 |
| First published | 2019-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | giseudo, viniazvd |

## Links

- npm: https://www.npmjs.com/package/vue-coe-progress
- npm.io page: https://npm.io/package/vue-coe-progress

## Recent versions

- 0.2.2 (latest) — 2019-12-23
- 0.1.9 — 2019-12-23
- 0.1.8 — 2019-12-16
- 0.1.7 — 2019-12-10
- 0.1.6 — 2019-12-10
- 0.1.5 — 2019-12-02
- 0.1.4 — 2019-12-02
- 0.1.3 — 2019-12-02
- 0.1.2 — 2019-12-02
- 0.1.1 — 2019-12-02
- 0.1.0 — 2019-12-02

## README

<h1 align="center">vue-coe-progress ✅</h1>

<p align="center">
  <a href="#"><img src="https://img.shields.io/npm/l/vuelidation.svg" alt="License" target="_blank"></a>
</p>

<br>

<p align="center">
  ✨ <a href="#">Example(wip)</a>✨
</p>

<br>

## Install
`yarn add vue-coe-progress` or `npm install vue-coe-progress`

**Example**
```vue
<template>
  <div id="app">
    <pre v-for="file in $fileList" :key="file.id">
      <button @click="$abortRequest(file.id)">abort</button>

      <span>done: {{ file.done }}</span>
      <span>error: {{ file.error }}</span>
      <span>aborted: {{ file.aborted }}</span>
      <span>progress: {{ file.progress }}</span>
      <span>uploading: {{ file.uploading }}</span>
    </pre>

    <input type="file" multiple @change="setFile">

    <button @click.prevent="$upload">submit</button>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import VueCoeProgress from './VueCoeProgress'

export default Vue.extend({
  name: 'app',

  mixins: [
    VueCoeProgress({
      url: 'http://localhost:3000/',
      headers: { 'Authorization': 'Basic 48120481204120h08fhw' }
    })
  ],

  methods: {
    setFile (event: Event): void {
      const files = (event.target as HTMLInputElement).files

      if (files && files.length) this.$setFiles(files)
    }
  }
});
</script>
```

# server example:
https://gist.github.com/viniazvd/ab0b546a7b1b9171b9aa5e3ee67de63b

## States

Name       |   type  |   default  | About
---------- | ------- | ---------- | ------
files      |  Object |   `{}`     | object with file handling states
$fileList  |  Array  |   `[]`     | mapped file list

## Methods

Name            | Params                                    
--------------- | ----------------------------------------- 
$setStates      | -                            
$upload         | -
$setFiles       | data: FileList
$abortRequest   | id: string                                
$handleStart    | id: string, event: Event                  
$handleFinish   | id: string, event: Event                  
$handleProgress | id: string, event: ProgressEvent          
$handleError    | id: string, message: string, event: Event 

## disclaimer:
It's a mixin, you can overwrite them! :D

## contributors:
- https://github.com/Giseudo

---
_Source: https://npm.io/package/vue-coe-progress · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
