This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

修复date日历月份不正确的bug;优化select样式;修复clickoutside的逻辑

old
宇天 2019-08-20 12:01:22 +08:00
parent e3fd2190fd
commit 717f170a66
3 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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 = `${

View File

@ -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)
}) })
} }