mirror of
https://github.com/element-plus/element-plus.git
synced 2025-08-16 12:04:12 +08:00

* perf: change to import-x * feat: add rules * chore: fix rule * chore: fix * chore: fix * chore: fix * style: `pnpm lint:fix` * Revert "style: `pnpm lint:fix`" This reverts commit db0116a288299c507e3cfc4d7a22e2207265d920. * Revert "chore: fix" This reverts commit 69c82a90c01525e38180be4c21e8ef5602512318. * chore: fix * style: `pnpm lint:fix` * fix: lint * chore: `pnpm format`
36 lines
1.0 KiB
Vue
36 lines
1.0 KiB
Vue
<template>
|
|
<el-calendar ref="calendar">
|
|
<template #header="{ date }">
|
|
<span>Custom header content</span>
|
|
<span>{{ date }}</span>
|
|
<el-button-group>
|
|
<el-button size="small" @click="selectDate('prev-year')">
|
|
Previous Year
|
|
</el-button>
|
|
<el-button size="small" @click="selectDate('prev-month')">
|
|
Previous Month
|
|
</el-button>
|
|
<el-button size="small" @click="selectDate('today')">Today</el-button>
|
|
<el-button size="small" @click="selectDate('next-month')">
|
|
Next Month
|
|
</el-button>
|
|
<el-button size="small" @click="selectDate('next-year')">
|
|
Next Year
|
|
</el-button>
|
|
</el-button-group>
|
|
</template>
|
|
</el-calendar>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref } from 'vue'
|
|
|
|
import type { CalendarDateType, CalendarInstance } from 'element-plus'
|
|
|
|
const calendar = ref<CalendarInstance>()
|
|
const selectDate = (val: CalendarDateType) => {
|
|
if (!calendar.value) return
|
|
calendar.value.selectDate(val)
|
|
}
|
|
</script>
|