【前端】ant-design-vue 汉化 配置 中文语言

<template>
  <a-locale-provider :locale="zh_CN">
    <div id="app">
      <router-view></router-view>
    </div>
  </a-locale-provider>
</template>

<script>
import zh_CN from "ant-design-vue/lib/locale-provider/zh_CN";
export default {
  name: 'App',
  data() {
    return {
      zh_CN
    };
  }
}
</script>

版本4.0+

<template>
  <a-locale-provider :locale="zh_CN">
    <div id="app">
      <router-view></router-view>
    </div>
  </a-locale-provider>
</template>

<script>
import zh_CN from "ant-design-vue/lib/locale/zh_CN";
export default {
  name: 'App',
  data() {
    return {
      zh_CN
    };
  }
}
</script>