mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-15 17:31:43 +08:00
40 lines
634 B
Vue
40 lines
634 B
Vue
|
<docs>
|
|||
|
---
|
|||
|
order: 0
|
|||
|
title:
|
|||
|
zh-CN: 基本
|
|||
|
en-US: Basic
|
|||
|
---
|
|||
|
|
|||
|
## zh-CN
|
|||
|
|
|||
|
一个通用的日历面板,支持年/月切换。
|
|||
|
|
|||
|
## en-US
|
|||
|
|
|||
|
A basic calendar component with Year/Month switch.
|
|||
|
|
|||
|
</docs>
|
|||
|
<template>
|
|||
|
<a-calendar v-model:value="value" @panelChange="onPanelChange" />
|
|||
|
</template>
|
|||
|
<script lang="ts">
|
|||
|
import { defineComponent, ref } from 'vue';
|
|||
|
import { Dayjs } from 'dayjs';
|
|||
|
|
|||
|
export default defineComponent({
|
|||
|
setup() {
|
|||
|
const value = ref<Dayjs>();
|
|||
|
const onPanelChange = (value: Dayjs, mode: string) => {
|
|||
|
console.log(value, mode);
|
|||
|
};
|
|||
|
|
|||
|
return {
|
|||
|
value,
|
|||
|
onPanelChange,
|
|||
|
};
|
|||
|
},
|
|||
|
});
|
|||
|
</script>
|
|||
|
|