Home >WeChat Applet >Mini Program Development >How to solve the problem that real device pictures are not displayed in the WeChat applet

How to solve the problem that real device pictures are not displayed in the WeChat applet

angryTom
angryTomOriginal
2020-03-23 10:48:3711035browse

How to solve the problem that real device pictures are not displayed in the WeChat applet

How to solve the problem that the WeChat applet real machine pictures are not displayed

: During the real machine test, it was found that some local pictures can be displayed on the development tool , but it cannot be displayed when previewing on the real machine

The code is written like this

<view class=&#39;seat-size&#39; wx:for="{{item}}" wx:key="index" wx:for-index="index" wx:for-item="citem">
<image src=&#39;../../../images/seaticon.png&#39; class=&#39;seat-img&#39; />
</view>

Cause and solution: The path written like this is not recognized on the real machine and needs to be written relative to the root directory

<image src=&#39;/images/seaticon.png&#39; class=&#39;seat-img&#39; />

Recommended learning: Small program development

Other solutions:

If it is not a path problem , there are several other ways to find the problem:

1. The picture is loaded using image;

2. There is no Chinese in the URL of the picture;

3. HTTP should be lowercase http and the suffix of the picture should be lowercase .png or .jpg

4. The domain name has been registered;

5. The picture name has no spaces

PHP Chinese Internet, a large number of MySQL video tutorials, welcome to learn!

The above is the detailed content of How to solve the problem that real device pictures are not displayed in the WeChat applet. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn