Home > Article > Web Front-end > How to set the view background image in uniapp
Uniapp method to set the view background image: This can be achieved by setting the background or [background-image] attribute of the view. The code is [
The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, Dell G3 computer.
Recommended ( Free): uni-app development tutorial
How to set the view background image in uniapp:
Yes This is achieved by setting the
background
orbackground-image
attribute of the view:<template> <view class="content" :style="{background: 'url('+imageURL+')'}"> <!-- 如果是设置background-image则写成:<view class="content" :style="{backgroundImage: 'url('+imageURL+')'}"> --> </view> </template> <script> export default { data() { return { imageURL: '/static/navigation/validCode_back.png' }; } } </script>Related free learning recommendations: Programming Video
The above is the detailed content of How to set the view background image in uniapp. For more information, please follow other related articles on the PHP Chinese website!