Commit 699a9dc8dda85aef19a94836d85b7a98113a1a8c

Authored by 梁灏
1 parent 3602b78d

update DatePicker

update DatePicker
src/components/date-picker/picker.vue
@@ -269,9 +269,9 @@ @@ -269,9 +269,9 @@
269 if (parsedValue[0].getTime() > parsedValue[1].getTime()) { 269 if (parsedValue[0].getTime() > parsedValue[1].getTime()) {
270 correctValue = oldValue; 270 correctValue = oldValue;
271 } else { 271 } else {
272 - // todo 判断disabledDate  
273 correctValue = formatter(parsedValue, format); 272 correctValue = formatter(parsedValue, format);
274 } 273 }
  274 + // todo 判断disabledDate
275 } else { 275 } else {
276 correctValue = oldValue; 276 correctValue = oldValue;
277 } 277 }
@@ -345,7 +345,13 @@ @@ -345,7 +345,13 @@
345 this.picker.resetView && this.picker.resetView(); 345 this.picker.resetView && this.picker.resetView();
346 }, 346 },
347 emitChange (date) { 347 emitChange (date) {
348 - this.$emit('on-change', formatDate(date, this.format || DEFAULT_FORMATS[this.type])); 348 + const format = this.format || DEFAULT_FORMATS[type];
  349 + const formatter = (
  350 + TYPE_VALUE_RESOLVER_MAP[this.type] ||
  351 + TYPE_VALUE_RESOLVER_MAP['default']
  352 + ).formatter;
  353 +
  354 + this.$emit('on-change', formatter(date, format));
349 } 355 }
350 }, 356 },
351 watch: { 357 watch: {
test/routers/date.vue
@@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
135 computed: {}, 135 computed: {},
136 methods: { 136 methods: {
137 change (date) { 137 change (date) {
138 -// console.log(date) 138 + console.log(date)
139 }, 139 },
140 change2 (s) { 140 change2 (s) {
141 // console.log(s) 141 // console.log(s)