0

I have a few text inputs that receive data from a backend API. I also need to allow user to enter his data to the inputs. How do I fix the code below to allow for it?

<input
  type='text'
  class='form-control input--square'
  id='cell'
  placeholder='Женат'
  :value='profile.persAdditionalInfo.family === 1 ? "Married" : "Not married"'
  @input='profile.persAdditionalInfo.family = $event.target.value'
/>

profile.persAdditionalInfo.family receives either 0 or 1.

1 Answer 1

2

Use v-model

data: () => ({
    message: null
})

<input v-model="message" placeholder="отредактируй меня">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.