diff --git a/README.md b/README.md index a049faf1..7ebde731 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,9 @@ Layui 是一套开源的 Web UI 组件库,采用自身轻量级模块化规范 ## 项目参与 [项目参与者](https://github.com/layui/layui/graphs/contributors) +## 在 Cloud IDE 中预览 +[https://idegithub.com/layui/layui](https://idegithub.com/layui/layui) + ## 破旧立新 🌱 Layui 原官网已于2021年10月13日下线。详见: > 1. Layui 原官网下线公告 2. Layui 原官网为什么要下线? @@ -72,4 +75,4 @@ Layui 原官网已于2021年10月13日下线。详见: --- 鉴于 Layui 相对庞大的受众群体,从此 Github 和 Gitee 平台将支撑起 Layui 的后续。
-**Layui 将继续陪伴着所有为之热爱的人们,共同去探索和论证「Layui 开发模式的可行性」** \ No newline at end of file +**Layui 将继续陪伴着所有为之热爱的人们,共同去探索和论证「Layui 开发模式的可行性」** diff --git a/preview.yml b/preview.yml new file mode 100644 index 00000000..28f7a9a7 --- /dev/null +++ b/preview.yml @@ -0,0 +1,11 @@ +# preview.yml +autoOpen: true # 打开工作空间时是否自动开启所有应用的预览 +apps: + - port: 3000 # 应用的端口 + run: # 应用的启动命令 + command: # 使用此命令启动服务,且不执行run + preview: /examples/all.html # 预览文件 + root: ./ # 应用的启动目录 + name: layui # 应用名称 + description: Classic modular Front-End UI library # 应用描述 + autoOpen: true # 打开工作空间时是否自动开启预览(优先级高于根级 autoOpen) diff --git a/src/modules/laydate.js b/src/modules/laydate.js index d3e283ee..fcd3fec2 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -1697,7 +1697,8 @@ if(td.hasClass(DISABLED)) return; var that = this - ,options = that.config; + ,options = that.config + ,panelIndex = index; // 记录点击的是哪一个面板的 if (that.rangeLinked) { if (that.endState || !that.startDate) { @@ -1762,7 +1763,7 @@ if (that.endState && that.autoCalendarModel.auto) { isChange = that.autoCalendarModel(); } - if (that.rangeLinked && that.endState && that.newDate(that.startDate) > that.newDate(that.endDate)) { + if ((isChange || that.rangeLinked && that.endState) && that.newDate(that.startDate) > that.newDate(that.endDate)) { var isSameDate = that.startDate.year === that.endDate.year && that.startDate.month === that.endDate.month && that.startDate.date === that.endDate.date; // 判断是否反选 var startDate = that.startDate; @@ -1777,7 +1778,21 @@ } isChange && (options.dateTime = lay.extend({}, that.startDate)); } - that.calendar(null, that.rangeLinked ? null : index, isChange || that.rangeLinked ? 'init' : null).done(null, 'change'); + if (that.rangeLinked) { + var dateTimeTemp = lay.extend({}, dateTime); + if (panelIndex && !index && !isChange) { // 处理可能出现的联动面板中点击右面板但是判定为开始日期这个时候点击头部的切换上下月第一次没有反应的问题 + // 选择了右面板但是判断之后作为开始时间 + var YM = that.getAsYM(dateTime.year, dateTime.month, 'sub'); + lay.extend(options.dateTime, { + year: YM[0] + ,month: YM[1] + }); + } + that.calendar(dateTimeTemp, panelIndex, isChange ? 'init' : null); + } else { + that.calendar(null, index, isChange ? 'init' : null); + } + that.endState && that.done(null, 'change'); } else if(options.position === 'static'){ //直接嵌套的选中 that.calendar().done().done(null, 'change'); //同时执行 done 和 change 回调 } else if(options.type === 'date'){