update DatePicker
update DatePicker
This commit is contained in:
parent
3602b78df8
commit
699a9dc8dd
2 changed files with 9 additions and 3 deletions
|
@ -269,9 +269,9 @@
|
||||||
if (parsedValue[0].getTime() > parsedValue[1].getTime()) {
|
if (parsedValue[0].getTime() > parsedValue[1].getTime()) {
|
||||||
correctValue = oldValue;
|
correctValue = oldValue;
|
||||||
} else {
|
} else {
|
||||||
// todo 判断disabledDate
|
|
||||||
correctValue = formatter(parsedValue, format);
|
correctValue = formatter(parsedValue, format);
|
||||||
}
|
}
|
||||||
|
// todo 判断disabledDate
|
||||||
} else {
|
} else {
|
||||||
correctValue = oldValue;
|
correctValue = oldValue;
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,13 @@
|
||||||
this.picker.resetView && this.picker.resetView();
|
this.picker.resetView && this.picker.resetView();
|
||||||
},
|
},
|
||||||
emitChange (date) {
|
emitChange (date) {
|
||||||
this.$emit('on-change', formatDate(date, this.format || DEFAULT_FORMATS[this.type]));
|
const format = this.format || DEFAULT_FORMATS[type];
|
||||||
|
const formatter = (
|
||||||
|
TYPE_VALUE_RESOLVER_MAP[this.type] ||
|
||||||
|
TYPE_VALUE_RESOLVER_MAP['default']
|
||||||
|
).formatter;
|
||||||
|
|
||||||
|
this.$emit('on-change', formatter(date, format));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
methods: {
|
||||||
change (date) {
|
change (date) {
|
||||||
// console.log(date)
|
console.log(date)
|
||||||
},
|
},
|
||||||
change2 (s) {
|
change2 (s) {
|
||||||
// console.log(s)
|
// console.log(s)
|
||||||
|
|
Loading…
Add table
Reference in a new issue