Commit 2bf3e04753487187d570779a0d581d3816d112a3

Authored by Aresn
Committed by GitHub
2 parents 1ba0bb6e e56c394d

Merge pull request #3629 from SergioCrisostomo/fix-week-number-width

Correct time layout when showing week numbers
src/components/date-picker/panel/Date/date-range.vue
... ... @@ -6,7 +6,7 @@
6 6 v-for="shortcut in shortcuts"
7 7 @click="handleShortcutClick(shortcut)">{{ shortcut.text }}</div>
8 8 </div>
9   - <div :class="[prefixCls + '-body']">
  9 + <div :class="panelBodyClasses">
10 10 <div :class="[prefixCls + '-content', prefixCls + '-content-left']" v-show="!isTime">
11 11 <div :class="[datePrefixCls + '-header']" v-show="currentView !== 'time'">
12 12 <span
... ... @@ -171,6 +171,15 @@
171 171 }
172 172 ];
173 173 },
  174 + panelBodyClasses(){
  175 + return [
  176 + prefixCls + '-body',
  177 + {
  178 + [prefixCls + '-body-time']: this.showTime,
  179 + [prefixCls + '-body-date']: !this.showTime,
  180 + }
  181 + ]
  182 + },
174 183 leftDatePanelLabel(){
175 184 return this.panelLabelConfig('left');
176 185 },
... ...
src/styles/components/date-picker.less
... ... @@ -205,7 +205,7 @@
205 205  
206 206 &-with-week-numbers{
207 207 .@{picker-prefix-cls}-panel{
208   - &-body{
  208 + &-body-date {
209 209 min-width: (@date-picker-cells-width-with-weeknumbers + 20) * 2;
210 210 }
211 211 }
... ... @@ -294,4 +294,4 @@
294 294 cursor: @cursor-disabled;
295 295 }
296 296 }
297   -}
298 297 \ No newline at end of file
  298 +}
... ...