2018-11-02 Element-UI的使用
2018-11-02 本文已影响0人
弥之怀旧
非常好用,官网就有非常清楚的使用方法
不过今天遇到一个小问题,就是官网给的中文,不知道为什么到了我的项目就成了英文了,


于是搜索资料发现,有一个element-ui的国际化使用(就是中英文切换)还挺方便的,以后可以轻松切换中英文版本。具体如下
在vue项目的main.js文件中,加入
// element-ui
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
Vue.use(ElementUI, { locale })
中英文切换就是倒数第二句。en为英文版,zh-CN为中文版。