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

422
Views
Vue-router: deshágase de la barra diagonal final en la URL

Configuración : vue 2.6.14 y vue-router, la configuración de mi enrutador:

 { mode: 'history', base: document.location.pathname, routes: [ { path: '/', name: 'main', component: Main, props: (route) => { return { id: route.query.id, }; }, pathToRegexpOptions: { strict: true, }, }, ], }

Problema : tengo URL como esta

 local.host/page/xxx_111.html?id=111

La base del enrutador es la ruta /page/xxx_111.html . En algún momento me gustaría cambiar la URL a través de la navegación programática para simplemente

 local.host/page/xxx_111.html

en otras palabras, para deshacerme de los parámetros de consulta, pero haga lo que haga, siempre obtengo

 local.host/page/xxx_111.html/

con barra inclinada :( ¿Cómo resolver esto?

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

0

Resuelto creando la path: '/*([\\w\\-]+_?[\\d]+.html)' que coincide con cualquier URL de tipo local.host/<ANYTHING>/xxx_111.html y llama así this.$router.push({ query: {} }) para deshacerse del parámetro de url sin agregar una barra diagonal a la url.

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!