sinat_41684925 2019-07-17 11:44 采纳率: 0%
浏览 5610
已结题

elment-ui的分页组件Pagination怎么变成中文的

图片说明要显示20条每页,50条每页........
总n页,
代码是这样写的,跟官网一样,但是总是显示英文的:

 <div class="page-box" v-if="testExcersize.length">
          <el-pagination background @size-change="paging.pageSizeChange" @current-change="paging.pageChange" :current-page.sync="paging.page" :page-sizes="paging.pageSizes" :page-size="paging.pageSize" layout="total,sizes, prev, pager, next" :total="count">
          </el-pagination>
        </div>
/**
 * @Author: ldw
 * @Date 2019/5/12
 * @Last Modified by:ldw
 * @Last Modified time:
*/
class elePaging {
  constructor(props) {
    this.page = 1;
    this.pageSize = 20;
    this.updateWay = null;
    this.pageSizes = [20, 50, 80, 100,200,9999];
    return this.set(props);
  }

  pageChange = (page) => {
    this.page = page;
    this.getPage();
  }

  pageSizeChange = (pageSize) => {
    this.page = 1;
    this.pageSize = pageSize;
    this.getPage();
  }

  prePage = () => {
    if (this.page > 1) {
      this.page = this.page - 1;
      this.getPage();
    }
  }

  getPage = async () => {
    if (this.updateWay && typeof this.updateWay == 'function') {
      this.updateWay(this.page, this.pageSize);
    }
  }

  set(props) {
    Object.assign(this, props);
    return this;
  }
}

export default elePaging;

使用了i18n可以切换语言:
图片说明
图片说明

  • 写回答

4条回答 默认 最新

  • dabocaiqq 2019-07-17 13:41
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题