Correct way to use router-link in Vue

In Ionic, we can set routerLink property in ionic components to enable navigation.
But, if we have to provide a simple link on a text, which is usually done in plain Vue as below,

    <router-link
      :to="{
        name: 'home'      }">
      Home
    </router-link>

what is the right way to accomplish same behavior in Ionic Vue ?

The name ion-router-link appears to be the Ionic equivalent of router-link in Ionic. But, it is not importable and the documentation says:

Note

Note: this component should only be used with vanilla and Stencil JavaScript projects. For Angular projects, use an <a> and routerLink with the Angular router.

I could not find any example of how to do this in Vue.
Anyone know how to do this? Using plain router-link works. But, I don’t know if it goes through the Ionic routing scheme . If it does, can we set router animation also?

1 Like