Skip to content

Commit

Permalink
fix the remove item
Browse files Browse the repository at this point in the history
  • Loading branch information
namadnuno committed Nov 4, 2019
1 parent b29eaca commit 9be78c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 41 deletions.
11 changes: 2 additions & 9 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 3 additions & 31 deletions demo/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -3712,7 +3684,7 @@ var render = function() {
attrs: { type: "button" },
on: {
click: function($event) {
return _vm.remove(_vm.index)
return _vm.$emit("remove")
}
}
},
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/Item.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<li class="file-item">
<a :href="'/' + attachment" target="_blank">{{ attachment.split('/').reverse()[0] }}</a>
<button class="btn remove" @click="remove(index)" type="button">
<button class="btn remove" @click="$emit('remove')" type="button">
<svg enable-background="new 0 0 515.556 515.556" viewBox="0 0 515.556 515.556" xmlns="http://www.w3.org/2000/svg"><path d="m64.444 451.111c0 35.526 28.902 64.444 64.444 64.444h257.778c35.542 0 64.444-28.918 64.444-64.444v-322.222h-386.666z"/><path d="m322.222 32.222v-32.222h-128.889v32.222h-161.111v64.444h451.111v-64.444z"/></svg>
</button>
</li>
Expand Down

0 comments on commit 9be78c9

Please sign in to comment.