Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

187
Vistas
How to handle non english character in vue-router as a path

How to have non-English characters in path as a Url?(If not wanting to do anything with server configs!) like the example below:

https://example.com/صفحه_مورد_نظر

Vue-router does not understand non-English characters!


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/صفحه_مورد_نظر',
      name: "home",
      component: Home,
    },  
  ],
});

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The solution is to use a built-in js function called encodeURI(). It is also helpful when dealing with non-English characters in other places like tooltips or when you hover over a link!


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/'+ encodeURI('صفحه_مورد_نظر'),
      name: "home",
      component: Home,
    },  
  ],
});

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda