美文网首页
Ant Design Vue使用Pagination组件为英文的

Ant Design Vue使用Pagination组件为英文的

作者: CoderZb | 来源:发表于2020-11-23 15:31 被阅读0次

分页组件我用的是Ant Design VuePagination 分页,在使用的过程,发现 每页条数跳转某个页面的功能是以英文的效果显示的。

image.png

解决办法:对组件进行国际化处理

  • App.vue文件中包裹一次,使之全局生效
<template>
  <a-config-provider :locale="zh_CN">
    <div id="app">
      <!-- 路由占位符 -->
      <router-view></router-view>
    </div>
  </a-config-provider>
</template>

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

<style>
html,
body,
#app {
  background-color: #f0f2f5;
}
</style>

最终效果

image.png

相关文章

网友评论

      本文标题:Ant Design Vue使用Pagination组件为英文的

      本文链接:https://www.haomeiwen.com/subject/edcviktx.html