mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 06:10:35 +03:00
refactor: decade separator can replace by css
This commit is contained in:
@@ -201,7 +201,15 @@ exports[`CalendarPanel prop: type=year 1`] = `
|
|||||||
class="mx-calendar-header-label"
|
class="mx-calendar-header-label"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
2010 ~ 2019
|
2010
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span
|
||||||
|
class="mx-calendar-decade-separator"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
2019
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,13 +36,17 @@
|
|||||||
<i class="mx-icon-right"></i>
|
<i class="mx-icon-right"></i>
|
||||||
</button>
|
</button>
|
||||||
<span class="mx-calendar-header-label">
|
<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
|
<button
|
||||||
v-else-if="panel === 'month'"
|
v-else-if="panel === 'month'"
|
||||||
class="mx-btn mx-btn-text"
|
class="mx-btn mx-btn-text"
|
||||||
@click="handelPanelChange('year')"
|
@click="handelPanelChange('year')"
|
||||||
>
|
>
|
||||||
{{ monthHeader }}
|
{{ calendarYear }}
|
||||||
</button>
|
</button>
|
||||||
<template v-else-if="panel === 'date'">
|
<template v-else-if="panel === 'date'">
|
||||||
<button
|
<button
|
||||||
@@ -177,12 +181,6 @@ export default {
|
|||||||
showIconArrow() {
|
showIconArrow() {
|
||||||
return this.panel === 'date';
|
return this.panel === 'date';
|
||||||
},
|
},
|
||||||
yearHeader() {
|
|
||||||
return `${this.calendarDecade} ~ ${this.calendarDecade + 9}`;
|
|
||||||
},
|
|
||||||
monthHeader() {
|
|
||||||
return this.calendarYear;
|
|
||||||
},
|
|
||||||
dateHeader() {
|
dateHeader() {
|
||||||
const monthBeforeYear = this.t('monthBeforeYear');
|
const monthBeforeYear = this.t('monthBeforeYear');
|
||||||
const yearFormat = this.t('yearFormat');
|
const yearFormat = this.t('yearFormat');
|
||||||
|
|||||||
@@ -183,6 +183,13 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx-calendar-decade-separator {
|
||||||
|
margin: 0 2px;
|
||||||
|
&:after {
|
||||||
|
content: '~';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.mx-calendar-content {
|
.mx-calendar-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 224px;
|
width: 224px;
|
||||||
|
|||||||
Reference in New Issue
Block a user