<template> <a-config-provider :locale="locale"> //建议直接包裹在最外层,若果你想全部转换为中文的话 </a-config-provider> <template> <script setup> import zhCN from 'ant-design-vue/es/locale/zh_CN'; import dayjs from 'dayjs'; import 'dayjs/locale/zh-cn'; const locale = zhCN dayjs.locale('en'); <script>
一定要注意引用dayjs,不引用dayjs我测试不行
标签:中文,zh,dayjs,locale,Vue3,antDesign,import,vite From: https://www.cnblogs.com/bisiyuan/p/17203100.html