mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
feat(components): calendar component header support slot (#3316)
* feat(components): calendar component header support slot * feat(components): calendar component header support slot * feat(components): calendar component header support slot
This commit is contained in:
parent
d43064c054
commit
629fef2993
@ -1,20 +1,25 @@
|
||||
<template>
|
||||
<div class="el-calendar">
|
||||
<div class="el-calendar__header">
|
||||
<div class="el-calendar__title">{{ i18nDate }}</div>
|
||||
<div v-if="validatedRange.length === 0" class="el-calendar__button-group">
|
||||
<el-button-group>
|
||||
<el-button size="mini" @click="selectDate('prev-month')">
|
||||
{{ t('el.datepicker.prevMonth') }}
|
||||
</el-button>
|
||||
<el-button size="mini" @click="selectDate('today')">
|
||||
{{ t('el.datepicker.today') }}
|
||||
</el-button>
|
||||
<el-button size="mini" @click="selectDate('next-month')">
|
||||
{{ t('el.datepicker.nextMonth') }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<slot name="header" :date="i18nDate">
|
||||
<div class="el-calendar__title">{{ i18nDate }}</div>
|
||||
<div
|
||||
v-if="validatedRange.length === 0"
|
||||
class="el-calendar__button-group"
|
||||
>
|
||||
<el-button-group>
|
||||
<el-button size="mini" @click="selectDate('prev-month')">
|
||||
{{ t('el.datepicker.prevMonth') }}
|
||||
</el-button>
|
||||
<el-button size="mini" @click="selectDate('today')">
|
||||
{{ t('el.datepicker.today') }}
|
||||
</el-button>
|
||||
<el-button size="mini" @click="selectDate('next-month')">
|
||||
{{ t('el.datepicker.nextMonth') }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
<div v-if="validatedRange.length === 0" class="el-calendar__body">
|
||||
<date-table :date="date" :selected-day="realSelectedDay" @pick="pickDay">
|
||||
|
Loading…
Reference in New Issue
Block a user