VUE UPLOAD 通过ACTION返回上传结果
通过Upload 的action方法返回不了结果,可以通过on-success方法中获取返回结果<Uploadaccept=".xls,.xlsx":action="uploadUrl":on-success="onSuccess":on-error="handleError":before-upload="beforeUpload"style="float:right"...
通过Upload 的action方法 返回不了结果,可以通过on-success方法中获取返回结果
<Upload accept=".xls, .xlsx" :action="uploadUrl" :on-success="onSuccess" :on-error="handleError" :before-upload="beforeUpload" style="float:right">
<Button type="primary" icon="ios-cloud-upload-outline" >导入</Button>
</Upload>
--------------------------------------------------------------------------------------------------------------
computed: {
uploadUrl() {
return baseUrl + "/ImportExcel/";
}
//file为ImportExcel方法返回的结果
onSuccess(file){
if(file.code=="1")
{
this.$Message.error("导入失败:" + file.msg);
return;
}
},
更多推荐
所有评论(0)