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

154
Views
Component display won't updated on V-if condition change

I'm not used to reactivity in VueJs. Here is my situation. It's a Django + Vue3 CDN Single Page Application project which means that I create the components as object. I have a sub component that I need to display when a set of data is ready. But since the request takes a long time, I've only placed my condition on the subcomponent.

When the value for the conditional render get to be true, I would like the subcomponent to be displayed. Once again, I don't know how to set that variable to be reactive.

let mainComponent = {
    component: { 'child-component': childComponent },
    data(){
       return {
          displayModal: false
          otherData: '',
          }
    },
    mounted: {
         axios.get(apiUrl).then((res) => {
               this.otherData = res.data;
               this.displayModal = true;
         }
    },
    template: `<div>
                   <child-component v-if="displayModal" :child-Props="otherData"></child-component>
               </div>
               `
    }

The situation I get is at the start the display value is false but when it becomes true, the child-component doesn't render. How can I make this reactive to the value change ?

about 4 years ago · Santiago Trujillo
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!