mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 04:50:36 +03:00
refactor: decade separator can replace by css
This commit is contained in:
@@ -14,7 +14,7 @@ exports[`CalendarPanel prop: type=date 1`] = `
|
|||||||
class="mx-icon-double-left"
|
class="mx-icon-double-left"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-left"
|
class="mx-btn mx-btn-text mx-btn-icon-left"
|
||||||
>
|
>
|
||||||
@@ -22,7 +22,7 @@ exports[`CalendarPanel prop: type=date 1`] = `
|
|||||||
class="mx-icon-left"
|
class="mx-icon-left"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-double-right"
|
class="mx-btn mx-btn-text mx-btn-icon-double-right"
|
||||||
>
|
>
|
||||||
@@ -30,7 +30,7 @@ exports[`CalendarPanel prop: type=date 1`] = `
|
|||||||
class="mx-icon-double-right"
|
class="mx-icon-double-right"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-right"
|
class="mx-btn mx-btn-text mx-btn-icon-right"
|
||||||
>
|
>
|
||||||
@@ -38,27 +38,27 @@ exports[`CalendarPanel prop: type=date 1`] = `
|
|||||||
class="mx-icon-right"
|
class="mx-icon-right"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
class="mx-calendar-header-label"
|
class="mx-calendar-header-label"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-current-month"
|
class="mx-btn mx-btn-text mx-btn-current-month"
|
||||||
>
|
>
|
||||||
|
|
||||||
Oct
|
Oct
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-current-year"
|
class="mx-btn mx-btn-text mx-btn-current-year"
|
||||||
>
|
>
|
||||||
|
|
||||||
2019
|
2019
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="mx-calendar-content"
|
class="mx-calendar-content"
|
||||||
>
|
>
|
||||||
@@ -67,12 +67,12 @@ exports[`CalendarPanel prop: type=date 1`] = `
|
|||||||
getcellclasses="function () { [native code] }"
|
getcellclasses="function () { [native code] }"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<table-month-stub
|
<table-month-stub
|
||||||
getcellclasses="function () { [native code] }"
|
getcellclasses="function () { [native code] }"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<table-date-stub
|
<table-date-stub
|
||||||
calendarmonth="9"
|
calendarmonth="9"
|
||||||
calendaryear="2019"
|
calendaryear="2019"
|
||||||
@@ -98,7 +98,7 @@ exports[`CalendarPanel prop: type=month 1`] = `
|
|||||||
class="mx-icon-double-left"
|
class="mx-icon-double-left"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-left"
|
class="mx-btn mx-btn-text mx-btn-icon-left"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
@@ -107,7 +107,7 @@ exports[`CalendarPanel prop: type=month 1`] = `
|
|||||||
class="mx-icon-left"
|
class="mx-icon-left"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-double-right"
|
class="mx-btn mx-btn-text mx-btn-icon-double-right"
|
||||||
>
|
>
|
||||||
@@ -115,7 +115,7 @@ exports[`CalendarPanel prop: type=month 1`] = `
|
|||||||
class="mx-icon-double-right"
|
class="mx-icon-double-right"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-right"
|
class="mx-btn mx-btn-text mx-btn-icon-right"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
@@ -124,20 +124,20 @@ exports[`CalendarPanel prop: type=month 1`] = `
|
|||||||
class="mx-icon-right"
|
class="mx-icon-right"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
class="mx-calendar-header-label"
|
class="mx-calendar-header-label"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text"
|
class="mx-btn mx-btn-text"
|
||||||
>
|
>
|
||||||
|
|
||||||
2019
|
2019
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="mx-calendar-content"
|
class="mx-calendar-content"
|
||||||
>
|
>
|
||||||
@@ -146,11 +146,11 @@ exports[`CalendarPanel prop: type=month 1`] = `
|
|||||||
getcellclasses="function () { [native code] }"
|
getcellclasses="function () { [native code] }"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<table-month-stub
|
<table-month-stub
|
||||||
getcellclasses="function () { [native code] }"
|
getcellclasses="function () { [native code] }"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -170,7 +170,7 @@ exports[`CalendarPanel prop: type=year 1`] = `
|
|||||||
class="mx-icon-double-left"
|
class="mx-icon-double-left"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-left"
|
class="mx-btn mx-btn-text mx-btn-icon-left"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
@@ -179,7 +179,7 @@ exports[`CalendarPanel prop: type=year 1`] = `
|
|||||||
class="mx-icon-left"
|
class="mx-icon-left"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-double-right"
|
class="mx-btn mx-btn-text mx-btn-icon-double-right"
|
||||||
>
|
>
|
||||||
@@ -187,7 +187,7 @@ exports[`CalendarPanel prop: type=year 1`] = `
|
|||||||
class="mx-icon-double-right"
|
class="mx-icon-double-right"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="mx-btn mx-btn-text mx-btn-icon-right"
|
class="mx-btn mx-btn-text mx-btn-icon-right"
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
@@ -196,16 +196,24 @@ exports[`CalendarPanel prop: type=year 1`] = `
|
|||||||
class="mx-icon-right"
|
class="mx-icon-right"
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
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>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="mx-calendar-content"
|
class="mx-calendar-content"
|
||||||
>
|
>
|
||||||
@@ -213,9 +221,9 @@ exports[`CalendarPanel prop: type=year 1`] = `
|
|||||||
decade="2010"
|
decade="2010"
|
||||||
getcellclasses="function () { [native code] }"
|
getcellclasses="function () { [native code] }"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!---->
|
<!---->
|
||||||
|
|
||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
</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