vue-coe-progress
<h1 align="center">vue-coe-progress ✅</h1>
Last updated 8 months ago by viniazvd .
MIT · Original npm · Tarball · package.json
$ cnpm install vue-coe-progress 
SYNC missed versions from official npm registry.

vue-coe-progress ✅

License


Example(wip)


Install

yarn add vue-coe-progress or npm install vue-coe-progress

Example

<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:

Current Tags

  • 0.2.2                                ...           latest (8 months ago)

11 Versions

  • 0.2.2                                ...           8 months ago
  • 0.1.9                                ...           8 months ago
  • 0.1.8                                ...           8 months ago
  • 0.1.7                                ...           8 months ago
  • 0.1.6                                ...           8 months ago
  • 0.1.5                                ...           8 months ago
  • 0.1.4                                ...           8 months ago
  • 0.1.3                                ...           8 months ago
  • 0.1.2                                ...           8 months ago
  • 0.1.1                                ...           8 months ago
  • 0.1.0                                ...           8 months ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (16)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |