原因:
CSP內容安全策略
解決辦法:
在index.html裏的meta元素加上img的允許格式,如下:
<meta
http-equiv="Content-Security-Policy"
content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline' *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *;img-src data: base64 *;"
/>
理論上只需要img-src *;
(表示允許所有格式)但是不知道爲啥我的手機就是不顯示base64的圖片,所以前面又加上了data: base64
,空格表示或
。