Before 1.0.2 – beta. 59

import lang from 'element-plus/lib/locale/lang/zh-cn'
import 'dayjs/locale/zh-cn'
import locale from 'element-plus/lib/locale'
locale.use(lang)
Copy the code

1.0.2-beta.59 and later (currently up to 1.0.2-beta.70)

Set the el-config-provider in app. vue and set the language to Chinese.

<! -- App.vue -->
<template>
  <el-config-provider :locale="locale">
    <router-view/>
  </el-config-provider>
</template>

<script lang="ts">
  import { ElConfigProvider } from 'element-plus'
  import zhCn from 'element-plus/lib/locale/lang/zh-cn'

  export default {
    components: {
      [ElConfigProvider.name]: ElConfigProvider
    },
    setup() {
      
      // Switch to Chinese
      let locale = zhCn

      return {
        locale
      }
      
    }
  }
</script>
Copy the code