pages.json
"globalStyle": {
"navigationStyle": "custom"
},
common.css
/* 全局样式 */
page{
margin: 0;
padding: 0;
width:100vw;
height: 100vh;
background: rgba(247,247,247,0.9);
}
.container{
width: 100%;
height: 100%;
}
/* 解决ios底部小黑线遮挡问题 */
.safeArea{
padding-bottom: env(safe-area-inset-bottom);
}
/* 背景图片 */
.image-content {
width: 100%;
position: fixed;
top: 0;
z-index: -1;
}
.image-content image {
display: block;
width: 100%;
}
index.vue
<view class="container">
<!-- 背景图片 -->
<view class="image-content">
<image mode="widthFix" src="@/static/images/login_bg.png" alt=""></image>
</view>
</view>
背景图
