Commit 5d097a0a authored by Dreamacro's avatar Dreamacro Committed by 杨奕

DatePicker: picker interaction (#6090)

* DatePicker: fix picker interaction

* DatePicker: fix picker interaction

* fix

* DatePicker: fix picker interaction
parent 7a84a3e4
......@@ -81,6 +81,11 @@
selectableRange(val) {
this.$refs.spinner.selectableRange = val;
},
date(val) {
this.currentDate = val;
this.reinitDate();
}
},
......@@ -157,13 +162,17 @@
const index = list.indexOf(this.selectionRange[0]);
const next = (index + step + list.length) % list.length;
this.$refs.spinner.emitSelectRange(mapping[next]);
}
},
created() {
reinitDate() {
this.hours = this.currentDate.getHours();
this.minutes = this.currentDate.getMinutes();
this.seconds = this.currentDate.getSeconds();
}
},
created() {
this.reinitDate();
},
mounted() {
......
......@@ -34,6 +34,7 @@ import Popper from 'element-ui/src/utils/vue-popper';
import Emitter from 'element-ui/src/mixins/emitter';
import Focus from 'element-ui/src/mixins/focus';
import ElInput from 'element-ui/packages/input';
import merge from 'element-ui/src/utils/merge';
const NewPopper = {
props: {
......@@ -449,8 +450,9 @@ export default {
},
mountPicker() {
this.panel.defaultValue = this.defaultValue || this.currentValue;
this.picker = new Vue(this.panel).$mount();
const defaultValue = this.defaultValue || this.currentValue;
const panel = merge({}, this.panel, { defaultValue });
this.picker = new Vue(panel).$mount();
this.picker.popperClass = this.popperClass;
this.popperElm = this.picker.$el;
this.picker.width = this.reference.getBoundingClientRect().width;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment