2022-05-03 21:15:49 +08:00
|
|
|
export default {
|
2022-05-04 16:25:53 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
confirmingDelete: false
|
|
|
|
};
|
|
|
|
},
|
2022-05-03 21:15:49 +08:00
|
|
|
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;
|
2022-05-03 21:15:49 +08:00
|
|
|
},
|
|
|
|
deleteComponent() {
|
|
|
|
$.ajax({
|
2022-05-05 18:56:31 +08:00
|
|
|
url: this.element.attributes.orderable.urls.delete_url,
|
2022-05-03 21:15:49 +08:00
|
|
|
type: 'DELETE',
|
|
|
|
success: (result) => {
|
|
|
|
this.$emit(
|
|
|
|
'component:delete',
|
|
|
|
result.data
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|