-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Version
3.0.0-alpha.9
Environment
vue@3.2.20
Reproduction link
Steps to reproduce
<script lang="ts"> import { toRefs, defineComponent } from 'vue'; import { ConfigProvider } from 'ant-design-vue'; import zhCN from 'ant-design-vue/es/locale/zh_CN'; import dayjs from 'dayjs'; import 'dayjs/locale/zh-cn'; import { prefixCls } from '#/settings/styleSetting'; import { createAppProviderCtx } from '../hooks/useAppCtx';export default defineComponent({
components: { ConfigProvider },
name: 'AppProvider',
props: {
prefixCls: {
type: String,
default: prefixCls,
},
locale: {
type: Object,
default: () => zhCN,
},
},
setup(props) {
dayjs.locale('zh-cn');
const { prefixCls } = toRefs(props);
createAppProviderCtx({ prefixCls });
},
});
</script>
What is expected?
正确设置locale
What is actually happening?
TypeError: Cannot read properties of undefined (reading 'antLocale')