a mobile vue component implementation for weui uploader
npm install -S vux-uploader-component
https://ejayyoung.github.io/vux-uploader-component/index.html
scan the qrcode and have a test in your device
<template>
<uploader
:files=[]
url="your remote upload url"
@onChange="onChange"
@onCancel="onCancel"
@onPreview="onPreview"
@onDelete="onDelete"
@onSuccess="onSuccess"
@onError="onError"
>
</uploader>
</template>
<script>
import Uploader from 'vux-uploader-component'
export default {
components: {
Uploader,
},
}
</script>
property | type | default | description |
---|---|---|---|
title | String | '图片上传' | 组件标题 |
files | Array | [] | 图片文件列表 |
limit | Number | String | 5 | 限制上传图片个数 |
capture | Number | String | false | 是否只选择调用相机 |
enableCompress | Boolean | true | 是否压缩 |
maxWidth | String | Number | 1024 | 图片压缩最大宽度 |
quality | String | Number | 0.92 | 图片压缩率 |
url | String | - | 上传服务器url |
autoUpload | Boolean | true | 是否自动开启上传 |
- 调用手机相机
- 获取图片并渲染到浏览器
- 解决图片EXIF旋转
- 预览图片
- 删除图片
- 支持上传图片配置
- 显示上传进度
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
For detailed explanation on how things work, consult the docs for vue-loader.