because it violates the following Content Security Policy directive: “img-src ‘self‘ data:base64“

问题

在这里插入图片描述
vue中放一张图片咋样都不显示,还报错,ma的

解决方法

在vue项目中的index.html文件中 修改

<meta http-equiv="Content-Security-Policy" content="default-src *;
   img-src * 'self' data: https:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *;
   style-src  'self' 'unsafe-inline' *">

直接复制,替换掉 就ok

希望能帮到你

猜你喜欢

转载自blog.csdn.net/weixin_44582045/article/details/129592595