How to make router update URL in browser address bar? #11422
-
|
In Vue 2 / Vuetify URL in adress bar updated without any additional configuration. However, after switching to Vue 3 / Quasar this does not happen neither in dev server nor when I build spa application. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
|
What does your |
Beta Was this translation helpful? Give feedback.
-
import type { RouteComponent, RouteRecordRaw } from "vue-router";
export const routes: readonly RouteRecordRaw[] = [
{
children: [
{
component: async (): Promise<RouteComponent> =>
import("./pages/Index.vue"),
path: ""
}
],
component: async (): Promise<RouteComponent> => import("./MainLayout.vue"),
path: "/"
},
{
component: async (): Promise<RouteComponent> =>
import("./pages/Error404.vue"),
path: "/:catchAll(.*)"
}
]; |
Beta Was this translation helpful? Give feedback.
-
|
Well, you only have the base route |
Beta Was this translation helpful? Give feedback.
-
|
I have catch all URL. In the index page I have: <q-page class="items-center justify-evenly row">
<router-link to="/zzz">404</router-link>
</q-page>This link shows 404 page and I expect that it should change URL in browser address bar to https://localhost:XXXX/zzz. This is actually router.ts that I got after quasar installation. I only fixed ESLint warnings. |
Beta Was this translation helpful? Give feedback.
-
|
This is the Works as expected for me. Seems like your fixing of ESLint warnings broke something. |
Beta Was this translation helpful? Give feedback.
-
|
It turned out that I had MemoryHistory instead of createWebHistory. |
Beta Was this translation helpful? Give feedback.
It turned out that I had MemoryHistory instead of createWebHistory.