uniapp如何设置view背景图
uniapp设置view背景图的方法:可以通过设置view的background或者【background-image】属性来实现,代码为【<view class="content" :style="{background: 'url】。
本教程操作环境:windows7系统、uni-app2.5.1版本、Dell G3电脑。
推荐(免费):uni-app开发教程
uniapp设置view背景图的方法:
可以通过设置view的background
或者background-image
属性来实现:
<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>
相关免费学习推荐:编程视频
以上就是uniapp如何设置view背景图的详细内容!