在网上查了很多需要moment,但其实官网上已经改用了dayjs,dayjs不需要额外安装依赖,直接按官网的例子配置即可
Ant Design Vue — An enterprise-class UI components based on Ant Design and Vue.js
App.vue代码如下即可:
<template>
<a-config-provider :locale="locale">
<router-view/>
</a-config-provider>
</template>
<script lang="ts" setup>
import { defineComponent, ref, reactive, onMounted, toRefs } from 'vue';
import zhCN from "ant-design-vue/es/locale/zh_CN";
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
const locale = ref(zhCN)
</script>