Can't load responsive images in q-img



  • The problem is when I use srcset to call my responsive pictures, I always get an error
    // GET http://localhost:8080/~assets/banner-lg 404 (Not Found) //

    <q-img src="~assets/banner-sm.jpg"
           srcset="~assets/banner-sm.jpg 400w,
                  ~assets/banner-lg.jpg 2x"
           :ratio="16/9"
    />
    

    擷取.PNG

    Whenever I take out the srcset part, the picture shows up successfully.

    <q-img src="~assets/banner-sm.jpg"/>
    

    Do I need a special way to call my pictures in srcset?
    Since the doc uses CDN Link to call pictures
    Can anyone tell me how to call pictures in assets folder in correct way?


Log in to reply