// Or use axios directly instead of this.$http. Vue.prototype.$http = axios; const app = new Vue({ el: '#root', data: { name: '', description: '' }, methods: { /** * * @param {Event} e */ onSubmit(e) { // or use @submit.prevent at the HTML call point // e.preventDefault(); this.$http.post('index.php/projects', this.$data).then(function () { console.log(arguments); }); } } });