Home  >  Article  >  Web Front-end  >  How to solve uniapp picture error problem

How to solve uniapp picture error problem

藏色散人
藏色散人Original
2020-12-17 16:49:316045browse

Uniapp image error solution: 1. Use "v-bind require" to solve the problem that the image cannot be loaded; 2. Use the "background-image" attribute to solve the image error problem. The statement is as follows "background-image:url(..);".

How to solve uniapp picture error problem

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version. This method is suitable for all brands of computers.

Recommended (free): uni-app development tutorial

Solution to the problem that uniapp images cannot be loaded

It is divided into two types

The first one

<image :src="require(&#39;../../static/picture&#39;)">   //使用v-bind + require

The second one

//第一种可以解决99%的问题,若有1%的没解决,可以使用background-image属性
background-image:url(../../static/picture.png);
 
//使用图片的最好是,本地图片使用背景图,万无一失,网络图片使用image src。
  

The above is the detailed content of How to solve uniapp picture error problem. 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