uniapp set dynamic background image

ps: When the applet is running, the background image uses the local path, which can be displayed normally in the development tool, but it cannot be displayed when debugging on the real machine

Solution: The way to use the remote path

<view class="nav-bg" :style="{ backgroundImage: 'url(' +imgURL + ')' }">	
	<!--内容-->
</view>

 

Guess you like

Origin blog.csdn.net/weixin_43973909/article/details/129583396