[Vuejs]-How to set v-model to dynamically coming textarea

0👍

You can achieve this requirement by following the below mentioned steps.

In child component :

SelectedSymptoms(event){
  this.$emit('send-selected-value', 'carrier');
}

In parent component :

<div v-on:send-selected-value="getSelectedValue(e)">
  <textarea type="textarea" v-model="modelValue" class="form-control" name="symptoms_mlform" id="symptoms_mlform">affective</textarea>
</div>

methods: {
  getSelectedValue: function (e) {
    this.modelValue = e;
  }
}

Leave a comment