//父元素
.a{
min-height: 100%;
display: flex;
flex-direction: column;
}
//子元素1
.b{
-webkit-box-flex: 0;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
}
//子元素2
.c{
flex: 1 0 auto;
display: flex;
align-items: flex-end;
justify-content: center;
padding: 50px 0;
.d{
text-align:center;
}
}
这样子元素2一直在app底部 用position定在底部会随着键盘弹上去
.a
.b
.c
.d
.pager-wrapper,
.indexBox {
height: 100%;
}
//首页
.indexBox {
display: flex;
flex-direction: column;
width: 100%;
background: url("~@/js/assets/picture/bg.jpg") center top no-repeat; //require("../assets/20jp.png"),
background-size: 100% auto;
.home {
flex: 1 0 auto;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
padding: 100px 0;
.goBtn {
width: 750px;
height: 147px;
background: url("~@/js/assets/picture/go.png") center no-repeat;
background-size: 100% auto;
}
.ruleTip {
width: 120px;
height: 50px;
line-height: 50px;
text-align: center;
border-bottom: 1px solid #2193df;
color: #2193df;
font-size: 28px;
}
}
}
<!-- 主页 -->
<div class="indexBox" v-show="homeShow">
<div class="home">
<div class="goBtn" @click="start"></div>
<div class="ruleTip" @click="ifshowRule">活动规则</div>
</div>
</div>