Blame view

ant-design-vue-jeecg/src/App.vue 894 Bytes
肖超群 authored
1
2
3
4
5
6
7
8
<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view/>
    </div>
  </a-config-provider>
</template>
<script>
肖超群 authored
9
10
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device'
肖超群 authored
11
肖超群 authored
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
export default {
  data() {
    return {
      locale: zhCN,
    }
  },
  created() {
    let that = this
    enquireScreen(deviceType => {
      // tablet
      if (deviceType === 0) {
        that.$store.commit('TOGGLE_DEVICE', 'mobile')
        that.$store.dispatch('setSidebar', false)
      }
      // mobile
      else if (deviceType === 1) {
        that.$store.commit('TOGGLE_DEVICE', 'mobile')
        that.$store.dispatch('setSidebar', false)
      } else {
        that.$store.commit('TOGGLE_DEVICE', 'desktop')
        that.$store.dispatch('setSidebar', true)
肖超群 authored
33
34
      }
肖超群 authored
35
    })
肖超群 authored
36
  }
肖超群 authored
37
}
肖超群 authored
38
39
</script>
<style>
肖超群 authored
40
41
42
#app {
  height: 100%;
}
肖超群 authored
43
</style>