diff --git a/src/datepicker/index.js b/src/datepicker/index.js index 2c862ed..79771c6 100644 --- a/src/datepicker/index.js +++ b/src/datepicker/index.js @@ -220,6 +220,7 @@ export default Anot.component('datepicker', {
@@ -290,6 +291,8 @@ export default Anot.component('datepicker', { value: '', // 用于显示在输入框里的日期变量 max: { year: 0, month: 0, day: 1 }, min: { year: 0, month: 0, day: 1 }, + top: 0, + left: 0, calendar: { // list: [1], // year: '', @@ -367,7 +370,10 @@ export default Anot.component('datepicker', { return num }, // 输入框获取焦点时,显示日历 - onFocus: function() { + onFocus: function(ev) { + let { top, left } = Anot(ev.target).offset() + this.top = top + 30 + this.left = left this.showCalendar = !0 }, back2today: function() { diff --git a/src/request/index.js b/src/request/index.js index eb64ad6..286c8ae 100644 --- a/src/request/index.js +++ b/src/request/index.js @@ -230,7 +230,9 @@ class _Request { // 否则拼接到url上 this.opt.data = Format.param(this.opt.data) - this.opt.url += (/\?/.test(this.opt.url) ? '&' : '?') + this.opt.data + if (this.opt.data) { + this.opt.url += (/\?/.test(this.opt.url) ? '&' : '?') + this.opt.data + } if (this.opt.cache === false) { this.opt.url +=