0👍
Try this
// Assuming that your error response obj is like
const registerErrors = {
email: ["The email has already been taken."],
first_name: ["The first name field is required."]
}
let errors = {};
Object.keys(registerErrors).forEach(key => {
errors[key]=registerErrors[key][0];
});
console.log(errors);
- [Vuejs]-How can I draw Canvas conditional onload with v-if?
- [Vuejs]-Dynamic routing of a dynamics components with Vue
Source:stackexchange.com