No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Can't load responsive images in q-img

    Help
    1
    1
    502
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bmw20075112 last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post