Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
Vue component Button doesn't works

Why does it work on the first, and it doesn't work on the second? First row work: https://imgur.com/b45QlU3 Last row doesn't work: https://imgur.com/S79Gq5M vue:

<template>
    <div>
        <div class="form-group" v-for="(input,index) in inputs" :key="index">
            <input type="text" name="medicine[]" class="form-control">
            <span>
                <a href="" @click.prevent="add(index)" v-show="index== inputs.length-1" style="color: green;">Add</a>

                <a href="" @click.prevent="remove(index)" v-show="index||(!index &&inputs.length >1)" style="color: red;">Remove</a>
            </span>
        </div>
    </div>
</template>
<script type="text/javascript">
    export default{
        data(){
            return{
                inputs:[{}]
            }
        },
        methods:{
            add(){
                this.inputs.push({
                    medicine:''
                })
            },
            remove(index)
            {
                this.inputs.splice(index,1)
            }
        }

    }
</script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!