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

204
Views
Vue: V-if with condition

in my vue application I have following code:

<div v-if="partner == true && kids == false" class="row">
   <input type="text" id="testInput">
</div>

Now when I want to try out this code snippet it does not render the input. I am pretty sure it should because the variables have the right value at this moment.

I also tried this but this does not work either:

<div v-if="partner && !kids" class="row">
   <input type="text" id="testInput">
<div>

Is the condition wrong or what is the problem with this code?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your code is fine:

new Vue({
  el: "#demo",
  data() {
    return {
      partner: true,
      kids: false
    }
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="demo">
  <div v-if="partner && !kids" class="row">
   <input type="text" id="testInput">
  </div>
</div>

about 4 years ago · Juan Pablo Isaza Report
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!