App.vue文件内更改如下
<template>
<el-config-provider :locale="locale">
<!-- 嵌套原来的组件在这里面 -->
</el-config-provider>
</template>
<script lang="ts" setup>
import { ConfigProvider } from 'ant-design-vue';
import { AppProvider } from '@/components/Application';
import { useTitle } from '@/hooks/web/useTitle';
import { useLocale } from '@/locales/useLocale';
// elementPlus国际化中文
import { ElConfigProvider } from 'element-plus'
import zhCn from "element-plus/es/locale/lang/zh-cn";
const locale = zhCn
// support Multi-language
const { getAntdLocale } = useLocale();
// Listening to page changes and dynamically changing site titles
useTitle();
</script>
Last modification:January 10, 2024
© Allow specification reprint