возможно надо как то так
deleteArticle: function (url) {
let self = this;
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
}, function () {
self.$http.delete(url, function () {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
});
}
UPD:
чтобы сформировать url для удаления статьи можно попробовать сделать так
blade
<a href="#"
v-on:click="deleteArticle()">Удалить</a>
layouts/app.blade.php
window.Laravel = <?= json_encode([
'base_url' => url(),
'article' => isset($article) ? $article->toArray() : null,
]); ?>
app.js
var article_form = new Vue({
el: '#article_form',
data: {
delete_url: window.Laravel.base_url + '/article/' + window.Laravel.article.id + '/delete'
},
methods: {
deleteArticle: function () {
var self = this;
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
}, function () {
self.$http.delete(self.delete_url, function () {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
});
}
}
});