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

170
Visualizações
What's the advantage of using an anonymous function to import a Vue component compared to importing it before the export statement?

I'm going through a Vuetify theme to learn how to use it and came across a new syntax I've never seen before for importing one Vue component into another.

I searched on Google, but can't find any reference to this method.

Instead of importing a component before the export, the component is imported as the return value from an arrow function. I know that it works because the site is working, I'm just trying to understand what is happening compared to the normal style of importing and what benefits this offers. Any insight is appreciated!

Typical Syntax:

<script>
import CoreAppBar from "@/components/CoreAppBar.vue";
import CoreFooter from "@/components/CoreFooter.vue";

export default {
  components: {
    CoreAppBar,
    CoreFooter,
  },
};
</script>

Syntax I'd like to understand:

<script>
  export default {
    name: 'App',

    components: {
      CoreAppBar: () => import('@/components/core/AppBar'),
      CoreFooter: () => import('@/components/core/Footer'),
    },
  }
</script>
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