diff --git a/components/vc-calendar/assets/index/DecadePanel.less b/components/vc-calendar/assets/index/DecadePanel.less index f83c591d0..b758eb57c 100644 --- a/components/vc-calendar/assets/index/DecadePanel.less +++ b/components/vc-calendar/assets/index/DecadePanel.less @@ -39,14 +39,15 @@ } } -.@{prefixClass}-decade-panel-prev-century-btn, .@{prefixClass}-decade-panel-next-century-btn { +.@{prefixClass}-decade-panel-prev-century-btn, +.@{prefixClass}-decade-panel-next-century-btn { position: absolute; top: 0; } .@{prefixClass}-decade-panel-next-century-btn { &:after { - content: '»' + content: '»'; } } @@ -54,7 +55,7 @@ user-select: none; left: 0; &:after { - content: '«' + content: '«'; } } @@ -111,10 +112,11 @@ } } -.@{prefixClass}-decade-panel-last-century-cell, .@{prefixClass}-decade-panel-next-century-cell { - .@{prefixClass}-decade-panel-decade{ +.@{prefixClass}-decade-panel-last-century-cell, +.@{prefixClass}-decade-panel-next-century-cell { + .@{prefixClass}-decade-panel-decade { user-select: none; -webkit-user-select: none; color: rgba(0, 0, 0, 0.25); } -} \ No newline at end of file +} diff --git a/components/vc-calendar/assets/index/MonthPanel.less b/components/vc-calendar/assets/index/MonthPanel.less index 1b35f0e6b..5bb3fc7a0 100644 --- a/components/vc-calendar/assets/index/MonthPanel.less +++ b/components/vc-calendar/assets/index/MonthPanel.less @@ -1,6 +1,6 @@ .@{prefixClass}-month-panel { left: 0; - top:0; + top: 0; bottom: 0; right: 0; background: #ffffff; @@ -43,14 +43,15 @@ } } -.@{prefixClass}-month-panel-prev-year-btn, .@{prefixClass}-month-panel-next-year-btn { +.@{prefixClass}-month-panel-prev-year-btn, +.@{prefixClass}-month-panel-next-year-btn { position: absolute; top: 0; } .@{prefixClass}-month-panel-next-year-btn { &:after { - content: '»' + content: '»'; } } @@ -59,7 +60,7 @@ left: 0; &:after { - content: '«' + content: '«'; } } @@ -96,8 +97,6 @@ .@{prefixClass}-month-panel-cell { text-align: center; - - .@{prefixClass}-month-panel-month { display: block; width: 46px; @@ -116,7 +115,7 @@ } } - &-disabled{ + &-disabled { .@{prefixClass}-month-panel-month { color: #bfbfbf; @@ -141,4 +140,4 @@ .@{prefixClass}-month-header-wrap { position: relative; height: 308px; -} \ No newline at end of file +} diff --git a/components/vc-calendar/assets/index/YearPanel.less b/components/vc-calendar/assets/index/YearPanel.less index 6b31dc8ec..77ba5c778 100644 --- a/components/vc-calendar/assets/index/YearPanel.less +++ b/components/vc-calendar/assets/index/YearPanel.less @@ -43,14 +43,15 @@ } } -.@{prefixClass}-year-panel-prev-decade-btn, .@{prefixClass}-year-panel-next-decade-btn { +.@{prefixClass}-year-panel-prev-decade-btn, +.@{prefixClass}-year-panel-next-decade-btn { position: absolute; top: 0; } .@{prefixClass}-year-panel-next-decade-btn { &:after { - content: '»' + content: '»'; } } @@ -59,7 +60,7 @@ left: 0; &:after { - content: '«' + content: '«'; } } @@ -125,10 +126,11 @@ } } -.@{prefixClass}-year-panel-last-decade-cell, .@{prefixClass}-year-panel-next-decade-cell { - .@{prefixClass}-year-panel-year{ +.@{prefixClass}-year-panel-last-decade-cell, +.@{prefixClass}-year-panel-next-decade-cell { + .@{prefixClass}-year-panel-year { user-select: none; -webkit-user-select: none; color: rgba(0, 0, 0, 0.25); } -} \ No newline at end of file +} diff --git a/components/vc-calendar/src/Calendar.jsx b/components/vc-calendar/src/Calendar.jsx index 909d21ad5..d4079f855 100644 --- a/components/vc-calendar/src/Calendar.jsx +++ b/components/vc-calendar/src/Calendar.jsx @@ -7,7 +7,7 @@ import moment from 'moment'; import DateTable from './date/DateTable'; import CalendarHeader from './calendar/CalendarHeader'; import CalendarFooter from './calendar/CalendarFooter'; -import CalendarMixin, {getNowByCurrentStateValue} from './mixin/CalendarMixin'; +import CalendarMixin, { getNowByCurrentStateValue } from './mixin/CalendarMixin'; import CommonMixin from './mixin/CommonMixin'; import DateInput from './date/DateInput'; import enUs from './locale/en_US'; @@ -74,8 +74,8 @@ const Calendar = { }); }, }, - mounted(){ - this.$nextTick(()=>{ + mounted() { + this.$nextTick(() => { this.saveFocusElement(DateInput.getInstance()); }); }, @@ -167,7 +167,7 @@ const Calendar = { source: 'dateInput', }); }, - onDateInputSelect (value) { + onDateInputSelect(value) { this.onSelect(value, { source: 'dateInputSelect', }); @@ -269,11 +269,12 @@ const Calendar = { onSelect={this.onDateInputSelect} /> ) : null; - const children =[]; + const children = []; if (props.renderSidebar) { children.push(props.renderSidebar()); } - children.push(