Отправка данных vue в качестве тела для отправки запроса с использованием ресурса vue
<script>
//var VueValidator = require ('vue-validator');
new Vue({
el: '#app',
data: {
email: '',
password: '',
_token: '{{csrf_token()}}',
uid: '{{$row->id}}'
},
methods: {
changeCredentials: function (e) {
console.log(this.email); --> **RETURNS EMPTY**
var resource = this.$resource('myurl/{id}');
resource.save({id: this.uid}, {body: function () {
console.log(this.data);
return this.data;
}}).then((response) => {
// success callback
console.log(response);
}, (response) => {
// error callback
});
//alert('here');
}
}
});
</script>
Можете ли вы сказать мне, почему работает this.uid, а не this.email? Спасибо