我想用flex布局把余额、钱
往右边靠这样要怎么写html
<div class="dataList" style="background: #E9E9E9" v-for="(data, index) in unavailableData" :key="data.voucherId">
<ul>
<li>
<div class="userInfo">
<span>打车券-</span>
<span>{{data.voucherReturnCode ? '个人' : '公共'}}</span>
</div>
<div class="dataTime">
{{data.voucherReturnCode ? '余额' : '有效期至'}}
</div>
</li>
<li :class="{'fontBase' : data.voucherReturnCode}">
<div class="numOrResc">
{{data.voucherReturnCode ? data.voucherReturnCode : data.voucherResc}}
</div>
<div class="voucherBalance" v-if="data.voucherReturnCode">
{{data.voucherBalance}}元
</div>
</li>
</ul>
</div>
less
.dataList{
box-sizing: border-box;
box-shadow: 0 2px 4px 0 #E7E7E7;
border-radius: 2px;
height: 78px;
padding: 0 15px;
margin-bottom: 10px;
display: flex;
align-items: center;
li {
display: flex;
justify-content:space-between;
list-style-type: none;
font-size: 12px;
&:nth-of-type(1) {
color: #666666;
font-size: 12px;
}
&:nth-of-type(2) {
font-size: 16px;
color: #344663;
}
}
.fontBase {
font-size: 16px !important;
}
}
最终的效果是这样的
为什么这么别扭的布局呢,改成下面