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{ width : 100px ; height : 100px ; } |
效果
代码片段: https://developers.weixin.qq.com/s/uH5UnAmu7m3Y
<view class="flex-wrap" >
<view class="flex-item {{item}}" wx:for="{{bgColor}}"></view>
</view>
正解!谢谢
按照教程提供下代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。