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

351
Views
Obtenga el nombre de la ruta de la ruta dentro del archivo de configuración de Nuxt

Tengo una aplicación y estoy jugando con la generación de mapas de sitios. Para el mapa del sitio, estoy usando @nuxtjs/sitemap - 2.4.0, y mi idea es ejecutar algunas funciones para generar mapas del sitio dinámicamente solo cuando el usuario abre la URL del mapa del sitio y no en cada inicio del servidor.

Estoy usando nuxt/vue-app 2.15.8 y me preguntaba cuál es la forma correcta de acceder a la página/ruta abierta actual dentro del archivo de configuración de Nuxt.

Esta es la configuración para el mapa del sitio en sí:

 { path: '/sitemaps/store-locations.xml', exclude: ['!**', '/'], // Skip all automatically generated routes i18n: true, xmlNs: 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"', routes: async function () { //$route gets undefined if (this.$route.path.split('/').pop() !== 'store-locations.xml') return //heavy functions which makes a lot of calls to DB const { getStores } = require('../../helpers/sitemap/storeLocatorRoutes'); return getStores(); },
about 4 years ago · Juan Pablo Isaza
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!