Vuetify: create image that links to another page

11,766

Solution 1

Try this (src vs :src):

<router-link to="/">
    <v-img src="require('@/assets/my-image.png')"></v-img>
</router-link>

Solution 2

i use some like this, and it works.

<a href="/">
 <v-img :src="require('@/assets/logo.png')"
 max-width="60"
 to="/afiliacion"
 width="100%">  </v-img> 
</a>
Share:
11,766

Related videos on Youtube

Johnny Metz
Author by

Johnny Metz

Updated on September 14, 2022

Comments

  • Johnny Metz
    Johnny Metz almost 2 years

    I'm trying to make an image link in my vue app. I've tried the following but it doesn't work:

    <v-img :src="require('@/assets/my-image.png')" to="/"></v-img>
    

    I've also tried wrapping the image in a router-link element but no luck:

    <router-link to="/">
        <v-img :src="require('@/assets/my-image.png')"></v-img>
    </router-link>
    

    Any idea what I'm doing wrong. This shouldn't be that difficult.