warning in vue-router 3.5.1: In Vue Router 4, the v-slot API will by default wrap its content with an <a> element
Solution 1:
This warning is appearing, because there is a change in Vue Router v4 that has changed how <router-link>
works, and this is letting you know of this change. It appears that you are using a <router-link>
component with the event
or tag
property, and this will not work in Vue Router v4.
This doesn't break your code on Vue Router v3 but if you wanted to remove the warning, the best way to do that is use the new v-slot API which will also be supported in Vue Router v3.
Instead of
<router-link event="dblclick" :to="{name: 'route.name'}" tag="div">Content</router-link>
this then becomes
<router-link custom :to="{name: 'route.name'}" v-slot="{ href, navigate }">
<div @dblclick="navigate">Content</div>
</router-link>
More Info: https://next.router.vuejs.org/guide/migration/index.html#removal-of-event-and-tag-props-in-router-link