forked from cars10/elasticvue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvuetify.js
44 lines (37 loc) · 891 Bytes
/
vuetify.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import Vue from 'vue'
import Vuetify from 'vuetify/lib'
import en from 'vuetify/lib/locale/en'
import zhHans from 'vuetify/lib/locale/zh-Hans'
import store from '@/store'
import '@mdi/font/css/materialdesignicons.css'
import colors from 'vuetify/lib/util/colors'
Vue.use(Vuetify)
const basicColors = {
success: colors.green.darken3,
error: colors.red.darken4,
'primary-button': colors.blue.darken2
}
const getVuetifyLocale = () => {
const currentLocale = store.state.language.language
switch (currentLocale) {
case 'cn':
return 'zhHans'
default:
return currentLocale
}
}
const vuetify = new Vuetify({
icons: { iconfont: 'mdi' },
theme: {
themes: {
dark: basicColors,
light: basicColors
},
dark: store.state.theme.dark
},
lang: {
locales: { en, zhHans },
current: getVuetifyLocale()
}
})
export default vuetify