竖直居中
<view class="aaa">
<view>123</view>
<view>123</view>
</view>
<style>
.aaa{
width: 100%;
height: 150px;
border: 1px solid #0000FF;
display: flex;
flex-direction: column;
justify-content: center;
}
</style>
水平居中
<view class="aaa">
<view>123</view>
<view>123</view>
</view>
<style>
.aaa{
width: 100%;
height: 150px;
border: 1px solid #0000FF;
display: flex;
flex-direction: row;
justify-content: center;
}
</style>