0👍
I solved it instead of this.employees = response.data; it should be this.employees = response.data.data;
methods: {
getEmployeesbyCompany: function() {
axios
.get("api/getEmployees", {
params: { company_id: this.form.company_id }
})
.then(
function(response) {
this.employees = response.data.data;
}.bind(this)
);
},
getResults(page = 1) {
axios.get("api/employee?page=" + page).then(response => {
this.employees = response.data;
});
axios
.get("api/getEmployees?page=" + page, {
params: { company_id: this.form.company_id }
})
.then(
function(response) {
this.employees = response.data.data;
}.bind(this)
);
},
- [Vuejs]-What is the difference between importing in <style> and <script> vuejs?
- [Vuejs]-Only Deleting item from frontend not from MongoDB
Source:stackexchange.com