Solía tener mi URL así
http://localhost:8080/url-groups/edit/14Ahora se ven así
http://localhost:8080/#/url-groups/edit/14Este fn solía cortarlo bien
links: function () { return [ { text: 'Home', disabled: false, href: '/' }, // { text: this.title, disabled: true, href: 'breadcrumbs_link_2' }, ...new URL(window.location.href).pathname .split('/') .slice(1) .map((seg) => ({ text: seg, disabled: false, href: seg })) ] }A Inicio > Grupo de URL > Editar > 14
¿Cómo puedo modificar arriba de fn() para que funcione con mi nuevo formato de URL?
Dividir el nombre de la ruta por / reemplazar '' por Home y luego unirlos usando > :
links: function () { return new URL(window.location.href).pathname.split('/') .map(token=>token?token:'Home') .join(' > ') }