Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
upload-imgs: 图片上传成功、失败钩子函数使用示例
  • Loading branch information
zhangxiaoshang committed Dec 9, 2019
commit a15a457e556f0d45d11af2ad1e7ac52b1ed33729
11 changes: 11 additions & 0 deletions src/plugins/custom/views/Demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
<upload-imgs ref="uploadEle33" :rules="rules" :before-upload="beforeFuc" :multiple="true" />
<div><el-button @click="getValue('uploadEle33')">获取当前图像数据</el-button></div>
</el-form-item>
<el-form-item label="上传成功、失败钩子函数">
<upload-imgs :multiple="true" :on-success="handleSuccess" :on-error="handleError" />
</el-form-item>
</el-form>
</div>
</div>
Expand Down Expand Up @@ -224,6 +227,14 @@ export default {
})
}, 3000)
},
handleSuccess(item) {
console.log('on-success', item)
this.$message.info('上传完成')
},
handleError(item) {
console.log('on-error', item)
this.$message.info('上传失败')
},
},
}
</script>
Expand Down