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

288
Views
Directorio anidado nuxt 3 + Vite

Quiero usar el directorio anidado en nuxt 3 beta con vite.

En Nuxt 2 estaba usando esta configuración en (nuxt.config.js) y funciona:

 components: [ { path: '~/components', // will get any components nested in let's say /components/test too pathPrefix: false, },],

Tengo esta organización de directorio:

 | components - Header.vue - Footer.vue | sections - HeroSection.vue

pero recibí este error cuando intento poner <HeroSection/> en pages/index.vue .

 [Vue warn]: Failed to resolve component: HeroSection If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. Invalid value used as weak map key

ya no funciona en nuxt 3 y hay que hacer otra configuracion? Porque no encuentro nada al respecto en el documento.

Gracias <3

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

El uso de directorios anidados requiere anteponer el nombre del directorio al componente:

 <template> <SectionsHeroSection /> </template>

Con este comportamiento, puede ser menos complejo al nombrar sus componentes:

 - components Header.vue Footer.vue - Sections Hero.vue

Para que podamos usar así

 <template> <SectionsHero /> </template>

Lea más en los documentos aquí: https://v3.nuxtjs.org/guide/directory-structure/components#component-names

about 4 years ago · Juan Pablo Isaza Report

0

Encontré esto en el documento:

 import { join } from 'pathe' import { defineNuxtModule } from '@nuxt/kit' export default defineNuxtModule({ hooks: { 'components:dirs'(dirs) { // Add ./components dir to the list dirs.push({ path: join(__dirname, 'components'), prefix: 'awesome' }) } } })

https://v3.nuxtjs.org/docs/directorio-estructura/componentes/

Pero no funciona con esta configuración:

 hooks: { 'components:dirs'(dirs) { // Add ./components dir to the list dirs.push({ path: join(__dirname, 'components/sections'), prefix: false }) } }
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!