Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

499
Visualizações
How to get $refs in Vue 3 nested app (Vue app in other Vue app)?

I try to get marriage of Vue 3 and my MVC app:

I have main container on _Layout.cshtml with Vue app initialized:

<div id="app">
    <el-container>
        <el-main>
            @RenderBody()
        </el-main>
    </el-container>
</div>

var appHome = createApp(config);
appHome.mount("#app");

Then in @RenderBody() I get page with another Vue app (another .cshtml page + another .js controller):

<div id="appInner" ref="appInner">
    ...
</div>

var appInner = createApp(config);
appInner.mount("#appInner");

After that I can get information about appInner in $refs of top app:

//it is from config of my main container app (appHome)
mounted() {
    console.log('this.$refs AppHome', this.$refs); //here I can see ref to appInner
},
    

The problem is that I have to get ref for appInner in $refs for my appInner instance, so I need to see in:

//it is from config of my inner app (appInner)
mounted() {
    console.log('this.$refs AppInner', this.$refs); //here I can not see ref to appInner but I need that
},

Is that possible to achieve this goal in some way?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda