Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda