例子:一行5个商品1200px,每个商品230px,向右间距12.5px
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
这样设置当一行不足5个商品时,商品不能居左显示,改进办法时去掉justify-content: space-between;
此时每个商品有margin-right,在商品渲染时加判断,当是第5个商品是设置没有间距
if((i+1)%5==0){
marginR="marginRight";}else{
marginR="";
}
.marginRight{
margin-right:0 !important;
}