)
})
+ it('can do initial navigation to /', async () => {
+ const router = createRouter({ history: createMemoryHistory(), routes: [] })
+ expect(router.currentRoute.value).toBe(START_LOCATION_NORMALIZED)
+ await router.push('/')
+ expect(router.currentRoute.value).not.toBe(START_LOCATION_NORMALIZED)
+ })
+
it('calls history.replace with router.replace', async () => {
const history = createMemoryHistory()
const { router } = await newRouter({ history })
>
</li>
<li>
- <router-link :to="{ name: 'home', query: { currency: '€uro', é: 'e' } }"
+ <router-link :to="{ path: '/', query: { currency: '€uro', é: 'e' } }"
>/currency=€uro&é=e (object)</router-link
>
</li>
export const router = createRouter({
history: routerHistory,
routes: [
- { path: '/', component: Home, name: 'home', alias: '/home' },
+ { path: '/', component: Home },
{ path: '/users/:id', name: 'user', component: User },
{ path: '/documents/:id', name: 'docs', component: User },
{ path: encodeURI('/n/€'), name: 'euro', component },