本文介绍了cloudinary图像未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用下一个js和cloudinary
所以我将图片上传到cloudinary,然后将URL放入react网址为 https://res.cloudinary.com/doqurzmbt/image/upload/v1594709094/google-analytics-ux_g6w5ti.jpg
但是图像未显示在反应中,这是我的codesandbox
https://codesandbox.io/s/cool-christian-y64eb?fontsize = 14&hidenavigation = 1& theme = dark
所以我试过我只是写了一个普通的图像标签和一个云反应的npm,但是也没有用
但是另一个链接工作得很好,这是什么问题?

i'm using next js and cloudinary
so I uploaded the image to the cloudinary and put the url in the reactThe url is https://res.cloudinary.com/doqurzmbt/image/upload/v1594709094/google-analytics-ux_g6w5ti.jpg
but the image did not show up in react this is my codesandbox
https://codesandbox.io/s/cool-christian-y64eb?fontsize=14&hidenavigation=1&theme=dark
so I tried I just wrote a general image tag and a cloud-react npm but also did not work
but the other link works very well what is the problem?

推荐答案

当我运行您的代码时,它就可以正常工作了.这是屏幕截图: https://res.cloudinary.com/shirly/image/upload/v1594753839/Screen%20Shot%202020-07-14%20at%2012.10.17%20PM_ulddld.png

When I run your code it's working on my end. here is a screenshot: https://res.cloudinary.com/shirly/image/upload/v1594753839/Screen%20Shot%202020-07-14%20at%2012.10.17%20PM_ulddld.png

我们的最佳做法是使用类似以下内容的

Our best practice will be to use something like:

<Image cloudName="doqurzmbt" publicId="google-analytics-ux_g6w5ti" width="300" crop="scale" />

与example.js代码中的代码相同.

Same as your code in the example.js code.

这篇关于cloudinary图像未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 16:22
查看更多