Commit 699a9dc8dda85aef19a94836d85b7a98113a1a8c

Authored by 梁灏
1 parent 3602b78d

update DatePicker

update DatePicker
src/components/date-picker/picker.vue
... ... @@ -269,9 +269,9 @@
269 269 if (parsedValue[0].getTime() > parsedValue[1].getTime()) {
270 270 correctValue = oldValue;
271 271 } else {
272   - // todo 判断disabledDate
273 272 correctValue = formatter(parsedValue, format);
274 273 }
  274 + // todo 判断disabledDate
275 275 } else {
276 276 correctValue = oldValue;
277 277 }
... ... @@ -345,7 +345,13 @@
345 345 this.picker.resetView && this.picker.resetView();
346 346 },
347 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 357 watch: {
... ...
test/routers/date.vue
... ... @@ -135,7 +135,7 @@
135 135 computed: {},
136 136 methods: {
137 137 change (date) {
138   -// console.log(date)
  138 + console.log(date)
139 139 },
140 140 change2 (s) {
141 141 // console.log(s)
... ...