I am working on a select
element for assigning persons
to a project
. My goal is to send the ID
of the selected person
object to a specific function
. Here is what I have tried so far:
<el-form-item label="Assign to:" prop="person">
<el-select v-model="form.persons" multiple value-key="id" id="person_id" @change="getData()" placeholder="Select Personal" class="max-input" filterable>
<el-option v-for="person in orderedPersons"
:label="person.name +' '+ person.last_name"
:key="person.id"
:value="person">
</el-option>
</el-select>
List of persons:
form: { persons: [],}
The Method:
getData() {
var pid;
this.pid = document.getElementById("person_id").value;
console.log(pid);
this.$axios.get("/person/hasproject/" + this.pid ).then(response => {
try {
notifications_success(response.data.userMessage);
} catch (error) {}
});
},
The issue I am facing is that the pid
(person ID) remains undefined, and I am struggling to find a solution. Any help or suggestions would be greatly appreciated.