vue.jsvuejs2vue-componentchinese-locale

Element UI Pagination in Chinese instead of English


I started using the very nice Element UI components, and when I try to add the pagination component in my project using

<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage4" :page-sizes="[100, 200, 300, 400]" :page-size="100" layout="total, sizes, prev, pager, next, jumper" :total="400">
</el-pagination>

the text appears in chineese like this: Element UI Pagination component in chineese instead of english

It also happens on their JSFiddle sample, but it's not happening on their website.

Do you know how can I use it in english?


Solution

  • import Vue from 'vue'
    import ElementUI from 'element-ui'
    import 'element-ui/lib/theme-chalk/index.css'
    import locale from 'element-ui/lib/locale/lang/en'
    import App from './App.vue'
    
    Vue.use(ElementUI, { locale })
    
    new Vue({
      el: '#app',
      render: h => h(App)
    })
    

    http://element.eleme.io/#/en-US/component/i18n