vue - 更改element-ui分頁組件的文字部分


vue - 更改element-ui分頁組件的文字部分

element-ui

國際化

import Vue from 'vue'
import ElementUI from 'element-ui'
import locale from 'element-ui/lib/locale/lang/en'

Vue.use(ElementUI, { locale })

數據結構字段

element-ui 源碼:element-ui/src/locale/lang/zh-CN.js

配置國際化

// main.js
import zhLocale from 'element-ui/lib/locale/lang/zh-CN';
zhLocale.el.pagination = {
  goto: '跳至',
  pagesize: '條/頁',
  total: `共計 {total} 條`,
  pageClassifier: '頁',
};
Vue.use(ElementUI, {
  locale: zhLocale,
});

// !!!NOTICE 需合並原配置,否則會導致未配置項文字丟失
// Vue.use(ElementUI, { // 未配置部分會丟失,如時間日期選擇器等
//   locale: {
//     el: {
//       pagination: {
//         goto: '跳至',
//         pagesize: '條/頁',
//         total: `共計 {total} 條`,
//         pageClassifier: '頁',
//       },
//     },
//   },
// });


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM