ant-design-vue/components/calendar/demo/basic.vue

40 lines
634 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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>