From 9be78c9384d51dd57fcca42a2c2b4c044c585d95 Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Mon, 4 Nov 2019 22:27:07 +0000 Subject: [PATCH] fix the remove item --- .idea/workspace.xml | 11 ++--------- demo/script.js | 34 +++------------------------------- src/Item.vue | 2 +- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5adf5f3..ece886a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,14 +2,7 @@ - - - - - - - - + diff --git a/demo/script.js b/demo/script.js index c016a12..384ff93 100644 --- a/demo/script.js +++ b/demo/script.js @@ -2271,35 +2271,7 @@ __webpack_require__.r(__webpack_exports__); _this.$emit('error', err); _this.sending = false; - }); // fetch(this.endpoint, { - // method: 'POST', - // body: formData - // } - // ) - // .then( - // fetchProgress({ - // onProgress(progress) { - // console.log( progress ); - // }, - // onError(err) { - // console.log(err); - // this.$emit('error', err); - // this.sending = false; - // }, - // }) - // ).then(response => response.json() ) - // .then(data => { - // }); - // .then(data => { - // this.attachments.push(data); - // this.$emit('input', this.attachments); - // this.$emit('success', data); - // this.sending = false; - // }).catch(err => { - // console.log(err); - // this.$emit('error', err); - // this.sending = false; - // }); + }); }, remove: function remove(index) { var file = this.attachments[index]; @@ -3712,7 +3684,7 @@ var render = function() { attrs: { type: "button" }, on: { click: function($event) { - return _vm.remove(_vm.index) + return _vm.$emit("remove") } } }, @@ -3772,7 +3744,7 @@ var render = function() { { staticClass: "uploader", class: { "is-loading": _vm.sending }, - attrs: { type: "button" }, + attrs: { type: "button", disabled: _vm.sending }, on: { click: function($event) { return _vm.$emit("click") diff --git a/src/Item.vue b/src/Item.vue index e9b779e..24a4020 100644 --- a/src/Item.vue +++ b/src/Item.vue @@ -1,7 +1,7 @@