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

28 lines
514 B
JavaScript
Raw Normal View History

export default {
2022-05-04 16:25:53 +08:00
data() {
return {
confirmingDelete: false
};
},
methods: {
showDeleteModal() {
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
);
}
});
}
}
};