Skip to content

Commit

Permalink
fix: 修复日历在rpx单位下布局异常
Browse files Browse the repository at this point in the history
  • Loading branch information
jry committed Aug 9, 2024
1 parent 37c84cb commit 1c9d86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/uni_modules/uview-plus/components/u-calendar/month.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@
const dayWidth = Number(parseFloat(this.width / 7).toFixed(3).slice(0, -1))
// 得出每个日期的宽度
// #ifdef APP-NVUE
style.width = addUnit(dayWidth)
style.width = addUnit(dayWidth, 'px')
// #endif
style.height = addUnit(this.rowHeight)
if (index2 === 0) {
// 获取当前为星期几,如果为0,则为星期天,减一为每月第一天时,需要向左偏移的item个数
week = (week === 0 ? 7 : week) - 1
style.marginLeft = addUnit(week * dayWidth)
style.marginLeft = addUnit(week * dayWidth, 'px')
}
if (this.mode === 'range') {
// 之所以需要这么写,是因为DCloud公司的iOS客户端的开发者能力有限导致的bug
Expand Down

0 comments on commit 1c9d86c

Please sign in to comment.