Skip to content

Commit bb93f20

Browse files
committed
edit no url
1 parent 759bd17 commit bb93f20

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rui-vue-image-crop-upload",
3-
"version": "2.5.16",
3+
"version": "2.5.18",
44
"description": "a vue plgin for image upload and crop(vue图片剪裁上传插件)",
55
"main": "upload-2.vue",
66
"scripts": {

upload-2.vue

+8-5
Original file line numberDiff line numberDiff line change
@@ -792,11 +792,8 @@ export default {
792792
ki
793793
} = this;
794794
this.$emit('crop-success', createImgUrl, field, ki);
795-
if(typeof url == 'string' && url){
796-
await this.upload();
797-
}else{
798-
this.off();
799-
}
795+
796+
await this.upload();
800797
},
801798
// 上传图片
802799
async upload() {
@@ -818,6 +815,12 @@ export default {
818815
} = this,
819816
fmData = new FormData();
820817
818+
// 检查是否有url
819+
if(typeof url != 'string' || !url){
820+
this.off();
821+
return;
822+
}
823+
821824
// 添加其他参数
822825
if (typeof params == 'object' && params) {
823826
Object.keys(params).forEach((k) => {

0 commit comments

Comments
 (0)