[Vuejs]-How to pass value to model (Vuejs 3)

0👍

this.patientRequestForCreationDtos is array. maybe you can do this.

checkValidation(patientRequestForCreationDto) {
  if (!patientRequestForCreationDto.drugName) {
    Swal.fire("drug name is required...");
    return;
  }
  return true;
},

0👍

if you’ll have only one element in patientRequestForCreationDtos then you gotta choose first element in the array and then check its property

checkValidation() {
  if (!this.patientRequestForCreationDtos[0].drugName) {
    Swal.fire("drug name is required...");
    return;
  }
  return true
},

also if your patientRequestForCreationDtos is always gonna be an array then you might find this helpful

Leave a comment