2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-12 11:32:27 +03:00

refactor: decade separator can replace by css

This commit is contained in:
mengxiong10
2019-11-14 14:09:08 +08:00
parent 6f70ffb633
commit fe323df718
3 changed files with 49 additions and 36 deletions
+6 -8
View File
@@ -36,13 +36,17 @@
<i class="mx-icon-right"></i>
</button>
<span class="mx-calendar-header-label">
<span v-if="panel === 'year'">{{ yearHeader }}</span>
<template v-if="panel === 'year'">
<span>{{ calendarDecade }}</span>
<span class="mx-calendar-decade-separator"></span>
<span>{{ calendarDecade + 9 }}</span>
</template>
<button
v-else-if="panel === 'month'"
class="mx-btn mx-btn-text"
@click="handelPanelChange('year')"
>
{{ monthHeader }}
{{ calendarYear }}
</button>
<template v-else-if="panel === 'date'">
<button
@@ -177,12 +181,6 @@ export default {
showIconArrow() {
return this.panel === 'date';
},
yearHeader() {
return `${this.calendarDecade} ~ ${this.calendarDecade + 9}`;
},
monthHeader() {
return this.calendarYear;
},
dateHeader() {
const monthBeforeYear = this.t('monthBeforeYear');
const yearFormat = this.t('yearFormat');
+7
View File
@@ -183,6 +183,13 @@
font-size: 14px;
}
.mx-calendar-decade-separator {
margin: 0 2px;
&:after {
content: '~';
}
}
.mx-calendar-content {
position: relative;
width: 224px;