Home  >  Q&A  >  body text

javascript - vue.js retrieves the image path from Alibaba Cloud oss ​​correctly, but the image on the page fails to load?

Use vue.js in webview to obtain the image path from Alibaba Cloud oss. After obtaining the data, you can open the image address with a browser and the image can be rendered successfully. However, the image sometimes fails to load on the webview page?

The binding image code is as follows:
<img class="img" :src="img.url" v-for="img in dataList.img">

Sometimes the image is loaded successfully, sometimes it fails. I don’t understand why, please give me some advice!

PHP中文网PHP中文网2711 days ago710

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-18 10:58:44

    What error does the console report when it fails? What is the information in the network?

    reply
    0
  • 阿神

    阿神2017-05-18 10:58:44

    If you go to Alibaba Cloud OSS to query the object temporarily, it will take time and may not be obtained before Vue renders.

    reply
    0
  • Cancelreply