Vuetify issue - why doesn't the v-img component display anything despite the image being passed in from a valid source?

后端 未结 6 923
死守一世寂寞
死守一世寂寞 2021-01-21 02:13

I wrote this code earlier in the summer before v-card-media was depreciated in favour of v-img. As far as I can see, I\'m using v-img correctly and passing in my source through

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 03:13

    just for the record if anyone have the same problem as me in the future:

    if you are trying to use the v-image in a v-for loop the code should look like this:

        
          
    
            
    
            
            
          
        
    

    use the fixed part of the path as a string in the require() and just the image as a variable. data properties should look like:

    testimonials: [
            {
              src: 'testimonials-1.jpg',
              title: 'Some name',
              description: 'Lorem ipsum'
            },
            {
              src: 'testimonials-2.jpg',
              title: 'Some name',
              description: 'Lorem ipsum'
            },
    

提交回复
热议问题