flex-direction:row 碰上wx:for 无效

发布于 8 年前作者 xiuyingfeng11993 次浏览最后编辑 8 年前来自 ask

lex-direction:row 碰上wx:for 无效,求大神帮忙!!!谢谢

index.js

data: {
    bgColor:['bc_red''bc_yellow''bc_green']
  },

index.wxml

<view class="flex-wrap" wx:for="{{bgColor}}">
  <view class="flex-item {{item}}"></view>
</view>

index.wxss

.flex-wrp{
    display:flex;
    flex-direction: row;
    background-color#FFFFFF;
}
.flex-item{
    width100px;
    height100px;
}

效果

2 回复