赞
踩
<a-upload name="file"
:action="uploadApi.uploadImg"
:multiple="true"
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"
:headers="headers"
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
>
<a-button icon="upload" @click="upload"> 上传</a-button>
</a-upload>
export default {
methods:{
data () {
return{
fileList: [],
headers: {
token: user.state.token
},
}
async handlePreview (file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj)
}
this.previewImage = file.url || file.preview
this.previewVisible = true
},
handleChange ({ fileList }) {
this.fileList = fileList
},
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。