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

127
Views
Determine si un componente está cargado Vue 3 y cargue un componente genérico si no

Estoy migrando un proyecto de Vue 2 a Vue 3. Necesito determinar si un componente está cargado y, si no lo está, cargar un componente genérico como marcador de posición. En Vue 2 pude hacerlo con el código de muestra. He estado leyendo los documentos de Vue 3 pero no puedo encontrar nada al respecto.

 import Vue from 'vue' import GenericComponent from 'components/GenericComponent' if (!Vue.options.components['custom-component']) { Vue.component('custom-component', GenericComponent) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puedes hacer esto:

 import { getCurrentInstance } from 'vue'; const app = getCurrentInstance() console.log('app component', app?.appContext.components['component-name'])

Tenga en cuenta que appContext.components solo contendrá componentes globales.

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!