修复date日历月份不正确的bug;优化select样式;修复clickoutside的逻辑
							parent
							
								
									e3fd2190fd
								
							
						
					
					
						commit
						717f170a66
					
				| 
						 | 
					@ -96,7 +96,6 @@
 | 
				
			||||||
  width: 200px;
 | 
					  width: 200px;
 | 
				
			||||||
  height: auto;
 | 
					  height: auto;
 | 
				
			||||||
  max-height: 200px;
 | 
					  max-height: 200px;
 | 
				
			||||||
  min-height: 46px;
 | 
					 | 
				
			||||||
  padding: 8px 0;
 | 
					  padding: 8px 0;
 | 
				
			||||||
  border-radius: 4px;
 | 
					  border-radius: 4px;
 | 
				
			||||||
  background: #fff;
 | 
					  background: #fff;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -238,6 +238,8 @@ function getCalendarTable({ year, month, max, min, last }) {
 | 
				
			||||||
  let isLimitYM = isLimited({ max, min }, { year, month })
 | 
					  let isLimitYM = isLimited({ max, min }, { year, month })
 | 
				
			||||||
  let list = []
 | 
					  let list = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  log(year, month, nums, numsFixed)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  for (let i = numsFixed; i <= nums; i++) {
 | 
					  for (let i = numsFixed; i <= nums; i++) {
 | 
				
			||||||
    let day = {
 | 
					    let day = {
 | 
				
			||||||
      weekend: false,
 | 
					      weekend: false,
 | 
				
			||||||
| 
						 | 
					@ -321,7 +323,7 @@ function getThisYearMonth() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//根据年份获取指定月份天数
 | 
					//根据年份获取指定月份天数
 | 
				
			||||||
function getTotalDays(year, month) {
 | 
					function getTotalDays(year, month) {
 | 
				
			||||||
  return new Date(year, month, 0).getDate()
 | 
					  return new Date(year, month + 1, 0).getDate()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//判断指定年月第一天是星期几
 | 
					//判断指定年月第一天是星期几
 | 
				
			||||||
| 
						 | 
					@ -460,6 +462,7 @@ export default class DatePicker {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _renderCalendar() {
 | 
					  _renderCalendar() {
 | 
				
			||||||
    var { calendar, max, min, last } = this.props
 | 
					    var { calendar, max, min, last } = this.props
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    calendar.list = getCalendarTable({ ...calendar, max, min, last })
 | 
					    calendar.list = getCalendarTable({ ...calendar, max, min, last })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.__CTRL__.children[2].textContent = `${
 | 
					    this.__CTRL__.children[2].textContent = `${
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -95,7 +95,7 @@ export const clickOutside = function(dom, fn = noop) {
 | 
				
			||||||
      if (dom === target || dom.contains(target)) {
 | 
					      if (dom === target || dom.contains(target)) {
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      fn(ev)
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    fn(ev)
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue