order属性定义项目的排列顺序。数值越小,排列越靠前,默认为0。
.item { order: <integer>; }
<view class='zong'>
<view class='fangxing1'>
<text>01</text>
</view>
<view class='fangxing2'>
<text>02</text>
</view>
<view class='fangxing3'>
<text>03</text>
</view>
</view>
.zong{
display: flex;
flex-direction: row ;
padding: 10px;/*内边距*/
}
.fangxing1{
width: 100px; height: 100px;
background-color: #f5f5dc;
margin: 10px;/*每个方框的外边距*/
}
.fangxing2{
width: 100px; height: 100px;
background-color: #f5f5dc;
margin: 10px;/*每个方框的外边距*/
}
.fangxing3{
width: 100px; height: 100px;
background-color: #f5f5dc;
margin: 10px;/*每个方框的外边距*/
}
.zong{
display: flex;
flex-direction: row ;
padding: 10px;/*内边距*/
}
.fangxing1{
width: 100px; height: 100px;
background-color: #f5f5dc;
margin: 10px;/*每个方框的外边距*/
order: 10;
}
.fangxing2{
width: 100px; height: 100px;
background-color: #f5f5dc;
margin: 10px;/*每个方框的外边距*/
order: 100;
}
.fangxing3{
width: 100px; height: 100px;
background-color: #f5f5dc;
margin: 10px;/*每个方框的外边距*/
order: -1;
}