[Vuejs]-How to pass selected item to api vujes

0👍

I think ‘v-model’ can be set for options.
or
const SignupData={
occupation:this.selectedRole.value
}

0👍

you have to pass your params in a object, you have two options:

with desctructoring of your SignupData const

axios.post('http://34.61.88.0:3000/api/newuser', {
    ...SignupData,
})

or

axios.post('http://34.61.88.0:3000/api/newuser', {
    occupation: this.selectedRole,
})

Leave a comment