cloudroam
2024-09-29 7e42cc8f4aa1c66077e12e140c3d5d3ded14a6b5
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 })
}