scinote-web/app/javascript/vue/protocol/mixins/components/delete.js

29 lines
550 B
JavaScript
Raw Normal View History

export default {
2022-05-04 16:25:53 +08:00
data() {
return {
confirmingDelete: false
};
},
methods: {
2022-05-10 19:28:09 +08:00
showDeleteModal(event) {
event.stopPropagation();
2022-05-04 16:25:53 +08:00
this.confirmingDelete = true;
},
closeDeleteModal() {
this.confirmingDelete = false;
},
deleteComponent() {
$.ajax({
url: this.element.attributes.orderable.urls.delete_url,
type: 'DELETE',
success: (result) => {
this.$emit(
'component:delete',
result.data
);
}
});
}
}
};