上传是将信息(网页、文字、图片、视频等)通过网页或者上传工具发布到远程服务器上的过程。
当需要上传一个或一些文件时。
当需要展现上传的进度时。
当需要使用拖拽交互时。
ng-model 数据结构
[{
id: '',
name: '',
progress: 100, //选填
showDelete: false, //选填
}]
ma-upload-config 配置详细
{
url: '/upload/index',
viewUrl: '/upload/download',
alias: 'file',
headers: {},
queue: [],
progress: 0,
autoUpload: true,
removeAfterUpload: false,
method: 'POST',
filters: [],
formData: [],
queueLimit: Number.MAX_VALUE,
withCredentials: false,
disableMultipart: false
multiple: false
limit: Number.MAX_VALUE,
size: 10 * 1024 * 1000,
size: {
gif: 10 * 1024 * 1000,
png: 10 * 1024 * 1000,
jpg: 10 * 1024 * 1000
},
accept: '',
uploadText: '上传图片',
convert: function (data, response){
}
}
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
ng-model | 必填 | String | - |
ma-upload-config | 必填 | JSON | - |
ma-show-delete | 必填 | Boolean | true |