Есть массив:
$this->dates[]=date("Y-m-d", strtotime('monday this week'));
$this->dates[]=date("Y-m-d", strtotime('tuesday this week'));
$this->dates[]=date("Y-m-d", strtotime('wednesday this week'));
$this->dates[]=date("Y-m-d", strtotime('thursday this week'));
$this->dates[]=date("Y-m-d", strtotime('friday this week'));
$this->dates[]=date("Y-m-d", strtotime('saturday this week'));
Отдаю в laravel
return response()->json(['dates'=>$this->dates]);
на клиент:
export default {
data(){
return {
dates: []
}
},
mounted() {
let self = this;
axios
.post('http://localhost:8000/foodmenulist')
.then(this.dates.push(response['dates'] ) ),
)
.catch(function (error) {
console.log(error.data);
self.$router.push('/');
});
},
Но вместо массива получаю undefined.