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

625
Vistas
Cómo eliminar /#/ de la url vue

Estoy trabajando en vue y al ver las páginas, el enlace aparece de la siguiente manera:

 http://localhost:8080/#/ http://localhost:8080/#/categorias

¿Cómo lo elimino?

para que se vea asi?

 http://localhost:8080/categorias http://localhost:8080/

este es mi enrutador js

 import { createRouter, createWebHashHistory } from 'vue-router' //import Home from '../views/Home.vue' import Inicio from '../components/Inicio.vue' const routes = [ { path: '/', name: 'inicio', component: Inicio }, { path: '/about', name: 'About', // route level code-splitting // this generates a separate chunk (about.[hash].js) for this route // which is lazy-loaded when the route is visited. component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') }, { path: '/categorias', name: 'Categorias', component: () => import(/* webpackChunkName: "about" */ '../components/Categorias.vue') }, { path: '/login', name: 'Login', component: () => import(/* webpackChunkName: "about" */ '../components/Login.vue') } ] const router = createRouter({ history: createWebHashHistory(), routes }) export default router

Agradezco cualquier ayuda gracias, ya que no he podido solucionarlo y es incomodo tener esa url de esa manera :D

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Use createWebHistory ( modo HTML5 ) en lugar de createWebHashHistory ( modo hash )

 import { createRouter, createWebHistory } from 'vue-router' ... const router = createRouter({ history: createWebHistory(), routes })
over 4 years ago · Santiago Trujillo Denunciar

0

vista

 import VueRouter from 'vue-router' const router = new VueRouter({ routes, mode:'history' })

nginx: cuando lo implementa en el servicio web (p. ej.: linux), muestra agregar esta configuración

 server { listen 80; server_name localhost; server_name_in_redirect off; location / { root /etc/nginx/html; // deploy html path index index.html index.htm; if (-d $request_filename) { rewrite ^/(.*) /index.html break; } if (!-e $request_filename) { rewrite ^/(.*) /index.html break; } }
over 4 years ago · Santiago Trujillo 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