Vue3 Vue Router

Posted on  by admin

In HTML5 history mode, router-link will intercept the click event so that the browser doesn't try to reload the page. When you are using the base option in HTML5 history mode, you don't need to include it in to prop's URLs. router-link exposes a low level customization through a scoped slot(opens new window).

How to manually install and set up the Routing package

Handling 404 Not Found

This is a more advanced API that primarily targets library authors but can come in handy for developers as well, most of the time in a custom component like a NavLink or other.

When using the v-slot API, it is required to pass one single child to router-link. If you don't, router-link will wrap its children in a span element. href: resolved url. This would be the href attribute of an a element. route: resolved normalized location. navigate: function to trigger the navigation.

It will automatically prevent events when necessary, the same way router-link does.

isActive: true if the active class should be applied. Allows to apply an arbitrary class. isExactActive: true if the exact active class should be applied. Allows to apply an arbitrary class.