0

Im new in vue js and trying to explore it. I have button and that button has an event click, once the button clicked, it will add an input field in my specific div.

Vue file

<div class="item form-group">
    <div class="col-md-6 col-sm-6 ">
        <button type="button" class="btn btn-secondary" @click="addSchedule"><i class="fa fa-plus"></i>Add Schedule</button>

    </div>
</div>
<div class="item form-group added-schedule">
<div class="col-md-4 col-sm-4 ">
    <button type="button" class="btn btn-secondary"><i class="fa fa-plus"></i>Add qqqqqqq</button>
   s
</div>
<div class="col-md-4 col-sm-4 ">
    <button type="button" class="btn btn-secondary"><i class="fa fa-plus"></i>Add asdasd</button>
</div>
<div class="col-md-4 col-sm-4 ">
    <button type="button" class="btn btn-secondary"><i class="fa fa-plus"></i>Add wwwwwww</button>
</div>

 addSchedule(e){
                e.preventDefault();
                return false;
    },

Scenario

enter image description here

User clicked the Add schdule,imagine the 3 buttons is my input fields

NOTE: The user can Add Schedule as many as the user like.

Question: How do I append the input fields in my class added-schedule once the button clicked?

Angel
  • 966
  • 4
  • 25
  • 60

0 Answers0