uniapp中在浏览器中预览正常,在小程序中预览,背景图不显示,
原因:微信小程序背景图支持base64格式,支持网络路径,不支持css本地路径
解决办法:
<view class="infos" :style="{backgroundImage:`url(${indexBackgroundImage})`,backgroundRepeat:'no-repeat', backgroundSize: '100% 65%'}"></view>
import indexBackgroundImage from "@/static/images/banner_bg04.png"
data() {
return {
indexBackgroundImage: indexBackgroundImage
}
}