# shb-vue-upload

> npm install shb-vue-upload

Latest version **1.0.1** (published 2019-05-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install shb-vue-upload
pnpm add shb-vue-upload
yarn add shb-vue-upload
bun add shb-vue-upload
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-05-28 |
| First published | 2019-05-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | suohongbo |

## Links

- npm: https://www.npmjs.com/package/shb-vue-upload
- Repository: https://github.com/shb190802/shb-vue-upload
- Homepage: https://github.com/shb190802/shb-vue-upload#readme
- Issues: https://github.com/shb190802/shb-vue-upload/issues
- npm.io page: https://npm.io/package/shb-vue-upload

## Recent versions

- 1.0.1 (latest) — 2019-05-28
- 1.0.0 — 2019-05-28

## README

# shb-vue-upload

## install

npm install shb-vue-upload

## use
### main.js
```javascript
import Vue from 'vue'
import App from './App.vue'
import VueUpload from 'shb-vue-upload'

Vue.use(VueUpload)
new Vue({
  render: h => h(App),
}).$mount('#app')
```
### app.vue
```javascript
<template>
  <div id="app">
    <vue-upload
      title="选择图片"
      active='/fileupload'
      name='SHB_FU_Input'
      @uploaded='showUploaded'
      @progress='onProgress'
      @error="error"
      class="upload"
      >
        <input type="button" value="upload" />
      </vue-upload>
  </div>
</template>
<script>
export default {
  name: 'app',
  components: {
  },
  methods: {
    showUploaded (res) {
      // console.log('showUploaded',res)
    },
    onProgress (cur, all) {
      // console.log(cur, all)
    },
    error (e) {
      // console.log('upload error ',e)
    }
  }
}
</script>
```
## 参数
| 参数        | 说明          |  类型  | 默认值 |
| --------    | -----:        | ----: |-----: |
| title        | 显示标题      |   String    | 浏览 |
| avtive       | 后台上传接口      |   String    | 不可为空 |
| name        | 后台接口获取参数名      |   String    | 不可为空|
| className | 自定义样式 | String | '' |
| accept | 文件类型，详见html file | String | '' |
| timeout | 超时时间（为0时没有超时限制） | Number | 0 |

## 回调方法
| 方法名        | 说明          |
| --------    | -----:        |
| uploaded        | 上传成功，返回后台接口返回数据（数据为text格式）      |
| error |错误回调，返回 {status，statusText} |
| progress | 上传进度 cur，totle |

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