From 478549bd30cceae5674b9c02ce6ba5064ec33234 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Wed, 16 Nov 2016 11:11:29 +0800 Subject: [PATCH] DatePicker: fix select year in month type, fixed #1070 --- packages/date-picker/src/panel/date.vue | 1 + packages/theme-default/src/date-picker/year-table.css | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/date-picker/src/panel/date.vue b/packages/date-picker/src/panel/date.vue index 0a9a9394..40454c58 100644 --- a/packages/date-picker/src/panel/date.vue +++ b/packages/date-picker/src/panel/date.vue @@ -271,6 +271,7 @@ this.resetDate(); } else { this.date.setMonth(month); + this.year && this.date.setFullYear(this.year); this.resetDate(); const value = new Date(this.date.getFullYear(), month, 1); this.$emit('pick', value); diff --git a/packages/theme-default/src/date-picker/year-table.css b/packages/theme-default/src/date-picker/year-table.css index b3e9bde8..29b6b50a 100644 --- a/packages/theme-default/src/date-picker/year-table.css +++ b/packages/theme-default/src/date-picker/year-table.css @@ -4,6 +4,7 @@ @b year-table { font-size: 12px; margin: -1px; + border-collapse: collapse; .el-icon { color: var(--datepicker-icon-color);