陶杰
2024-08-22 973662aeae3e7c788c14671d17c5962395141770
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import Vue from 'vue'
import Element from 'element-ui'
import zhCNLocale from 'element-ui/lib/locale/lang/zh-CN'
import enLocale from 'element-ui/lib/locale/lang/en'
import cssVars from 'css-vars-ponyfill'
 
const fontSizeList = ['mini', 'small', 'medium']
export default (ctx) => {
  const size = ctx.$elBusCookie.get('size') || 'small'
  ctx.store.commit('app/SET_SIZE', size)
  const locale = {
    'zh-CN': zhCNLocale,
    en: enLocale,
  }
  const currentLocale = ctx.i18n.getLocaleCookie() || ctx.i18n.defaultLocale
  ctx.i18n.setLocale(currentLocale)
  Vue.use(Element, { locale: locale[currentLocale], size })
}