制作了一个日历
制作了一个日历,日历中1号之前的空格在手机上显示不出来,而开发工具上面测试是好的,求大神指点下?
开发工具上面测试是这样的
手机上面显示
代码如下
< view class = "calendar_panel" > < view class = "calendar_box" > < view class = "weekday_label" >日</ view > < view class = "weekday_label" >一</ view > < view class = "weekday_label" >二</ view > < view class = "weekday_label" >三</ view > < view class = "weekday_label" >四</ view > < view class = "weekday_label" >五</ view > < view class = "weekday_label" >六</ view > </ view > < view class = "week" > < view wx:for = "{{emptynum}}" >\n</ view > < view wx:for = "{{lendata}}" >{{item+1}}</ view > </ view > </ view > |
1 回复
顺便再请教一个问题,上面只使用了一重wx:for,效率较低,第一次设计思路是使用双重wx:for嵌套,开发工具上面测试结果是正常的,而手机上面不仅显示不出1号之前的空格,而且所有日期排列在一行
< view class = "calendar_panel" > < view class = "calendar_box" > < view class = "weekday_label" >日</ view > < view class = "weekday_label" >一</ view > < view class = "weekday_label" >二</ view > < view class = "weekday_label" >三</ view > < view class = "weekday_label" >四</ view > < view class = "weekday_label" >五</ view > < view class = "weekday_label" >六</ view > </ view > < view class = "calendar_box" wx:for = "{{dateList}}" wx:for-item = "week" style = "{{index==0?'justify-content: flex-end;':''}}" > < view class = "weekday_label" wx:for = "{{week}}" > < text class = "{{item.value==selectedDate?'active_date':''}}" bindtap = "selectDate" data-date = "{{item}}" >{{item.date}}</ text > </ view > </ view > </ view > |
求大神指点迷津啊